1#![doc = "MAVLink python_array_test dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
21#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
22#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23#[cfg_attr(feature = "serde", serde(tag = "type"))]
24#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25#[repr(u32)]
26#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
27pub enum ActuatorConfiguration {
28 #[doc = "Do nothing."]
29 ACTUATOR_CONFIGURATION_NONE = 0,
30 #[doc = "Command the actuator to beep now."]
31 ACTUATOR_CONFIGURATION_BEEP = 1,
32 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
33 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
34 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
35 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
36 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
37 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
38 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
39 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
40}
41impl ActuatorConfiguration {
42 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
43}
44impl Default for ActuatorConfiguration {
45 fn default() -> Self {
46 Self::DEFAULT
47 }
48}
49#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
50#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
51#[cfg_attr(feature = "serde", serde(tag = "type"))]
52#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
53#[repr(u32)]
54#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
55pub enum ActuatorOutputFunction {
56 #[doc = "No function (disabled)."]
57 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
58 #[doc = "Motor 1"]
59 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
60 #[doc = "Motor 2"]
61 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
62 #[doc = "Motor 3"]
63 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
64 #[doc = "Motor 4"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
66 #[doc = "Motor 5"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
68 #[doc = "Motor 6"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
70 #[doc = "Motor 7"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
72 #[doc = "Motor 8"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
74 #[doc = "Motor 9"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
76 #[doc = "Motor 10"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
78 #[doc = "Motor 11"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
80 #[doc = "Motor 12"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
82 #[doc = "Motor 13"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
84 #[doc = "Motor 14"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
86 #[doc = "Motor 15"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
88 #[doc = "Motor 16"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
90 #[doc = "Servo 1"]
91 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
92 #[doc = "Servo 2"]
93 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
94 #[doc = "Servo 3"]
95 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
96 #[doc = "Servo 4"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
98 #[doc = "Servo 5"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
100 #[doc = "Servo 6"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
102 #[doc = "Servo 7"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
104 #[doc = "Servo 8"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
106 #[doc = "Servo 9"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
108 #[doc = "Servo 10"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
110 #[doc = "Servo 11"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
112 #[doc = "Servo 12"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
114 #[doc = "Servo 13"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
116 #[doc = "Servo 14"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
118 #[doc = "Servo 15"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
120 #[doc = "Servo 16"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
122}
123impl ActuatorOutputFunction {
124 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
125}
126impl Default for ActuatorOutputFunction {
127 fn default() -> Self {
128 Self::DEFAULT
129 }
130}
131#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
133#[cfg_attr(feature = "serde", serde(tag = "type"))]
134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
135#[repr(u32)]
136#[doc = "Enumeration of the ADSB altimeter types"]
137pub enum AdsbAltitudeType {
138 #[doc = "Altitude reported from a Baro source using QNH reference"]
139 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
140 #[doc = "Altitude reported from a GNSS source"]
141 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
142}
143impl AdsbAltitudeType {
144 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
145}
146impl Default for AdsbAltitudeType {
147 fn default() -> Self {
148 Self::DEFAULT
149 }
150}
151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
153#[cfg_attr(feature = "serde", serde(tag = "type"))]
154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
155#[repr(u32)]
156#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
157pub enum AdsbEmitterType {
158 ADSB_EMITTER_TYPE_NO_INFO = 0,
159 ADSB_EMITTER_TYPE_LIGHT = 1,
160 ADSB_EMITTER_TYPE_SMALL = 2,
161 ADSB_EMITTER_TYPE_LARGE = 3,
162 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
163 ADSB_EMITTER_TYPE_HEAVY = 5,
164 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
165 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
166 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
167 ADSB_EMITTER_TYPE_GLIDER = 9,
168 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
169 ADSB_EMITTER_TYPE_PARACHUTE = 11,
170 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
171 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
172 ADSB_EMITTER_TYPE_UAV = 14,
173 ADSB_EMITTER_TYPE_SPACE = 15,
174 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
175 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
176 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
177 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
178}
179impl AdsbEmitterType {
180 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
181}
182impl Default for AdsbEmitterType {
183 fn default() -> Self {
184 Self::DEFAULT
185 }
186}
187bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
188impl AdsbFlags {
189 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
190}
191impl Default for AdsbFlags {
192 fn default() -> Self {
193 Self::DEFAULT
194 }
195}
196bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
197impl AisFlags {
198 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
199}
200impl Default for AisFlags {
201 fn default() -> Self {
202 Self::DEFAULT
203 }
204}
205#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
207#[cfg_attr(feature = "serde", serde(tag = "type"))]
208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
209#[repr(u32)]
210#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
211pub enum AisNavStatus {
212 #[doc = "Under way using engine."]
213 UNDER_WAY = 0,
214 AIS_NAV_ANCHORED = 1,
215 AIS_NAV_UN_COMMANDED = 2,
216 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
217 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
218 AIS_NAV_MOORED = 5,
219 AIS_NAV_AGROUND = 6,
220 AIS_NAV_FISHING = 7,
221 AIS_NAV_SAILING = 8,
222 AIS_NAV_RESERVED_HSC = 9,
223 AIS_NAV_RESERVED_WIG = 10,
224 AIS_NAV_RESERVED_1 = 11,
225 AIS_NAV_RESERVED_2 = 12,
226 AIS_NAV_RESERVED_3 = 13,
227 #[doc = "Search And Rescue Transponder."]
228 AIS_NAV_AIS_SART = 14,
229 #[doc = "Not available (default)."]
230 AIS_NAV_UNKNOWN = 15,
231}
232impl AisNavStatus {
233 pub const DEFAULT: Self = Self::UNDER_WAY;
234}
235impl Default for AisNavStatus {
236 fn default() -> Self {
237 Self::DEFAULT
238 }
239}
240#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
242#[cfg_attr(feature = "serde", serde(tag = "type"))]
243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
244#[repr(u32)]
245#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
246pub enum AisType {
247 #[doc = "Not available (default)."]
248 AIS_TYPE_UNKNOWN = 0,
249 AIS_TYPE_RESERVED_1 = 1,
250 AIS_TYPE_RESERVED_2 = 2,
251 AIS_TYPE_RESERVED_3 = 3,
252 AIS_TYPE_RESERVED_4 = 4,
253 AIS_TYPE_RESERVED_5 = 5,
254 AIS_TYPE_RESERVED_6 = 6,
255 AIS_TYPE_RESERVED_7 = 7,
256 AIS_TYPE_RESERVED_8 = 8,
257 AIS_TYPE_RESERVED_9 = 9,
258 AIS_TYPE_RESERVED_10 = 10,
259 AIS_TYPE_RESERVED_11 = 11,
260 AIS_TYPE_RESERVED_12 = 12,
261 AIS_TYPE_RESERVED_13 = 13,
262 AIS_TYPE_RESERVED_14 = 14,
263 AIS_TYPE_RESERVED_15 = 15,
264 AIS_TYPE_RESERVED_16 = 16,
265 AIS_TYPE_RESERVED_17 = 17,
266 AIS_TYPE_RESERVED_18 = 18,
267 AIS_TYPE_RESERVED_19 = 19,
268 #[doc = "Wing In Ground effect."]
269 AIS_TYPE_WIG = 20,
270 AIS_TYPE_WIG_HAZARDOUS_A = 21,
271 AIS_TYPE_WIG_HAZARDOUS_B = 22,
272 AIS_TYPE_WIG_HAZARDOUS_C = 23,
273 AIS_TYPE_WIG_HAZARDOUS_D = 24,
274 AIS_TYPE_WIG_RESERVED_1 = 25,
275 AIS_TYPE_WIG_RESERVED_2 = 26,
276 AIS_TYPE_WIG_RESERVED_3 = 27,
277 AIS_TYPE_WIG_RESERVED_4 = 28,
278 AIS_TYPE_WIG_RESERVED_5 = 29,
279 AIS_TYPE_FISHING = 30,
280 AIS_TYPE_TOWING = 31,
281 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
282 AIS_TYPE_TOWING_LARGE = 32,
283 #[doc = "Dredging or other underwater ops."]
284 AIS_TYPE_DREDGING = 33,
285 AIS_TYPE_DIVING = 34,
286 AIS_TYPE_MILITARY = 35,
287 AIS_TYPE_SAILING = 36,
288 AIS_TYPE_PLEASURE = 37,
289 AIS_TYPE_RESERVED_20 = 38,
290 AIS_TYPE_RESERVED_21 = 39,
291 #[doc = "High Speed Craft."]
292 AIS_TYPE_HSC = 40,
293 AIS_TYPE_HSC_HAZARDOUS_A = 41,
294 AIS_TYPE_HSC_HAZARDOUS_B = 42,
295 AIS_TYPE_HSC_HAZARDOUS_C = 43,
296 AIS_TYPE_HSC_HAZARDOUS_D = 44,
297 AIS_TYPE_HSC_RESERVED_1 = 45,
298 AIS_TYPE_HSC_RESERVED_2 = 46,
299 AIS_TYPE_HSC_RESERVED_3 = 47,
300 AIS_TYPE_HSC_RESERVED_4 = 48,
301 AIS_TYPE_HSC_UNKNOWN = 49,
302 AIS_TYPE_PILOT = 50,
303 #[doc = "Search And Rescue vessel."]
304 AIS_TYPE_SAR = 51,
305 AIS_TYPE_TUG = 52,
306 AIS_TYPE_PORT_TENDER = 53,
307 #[doc = "Anti-pollution equipment."]
308 AIS_TYPE_ANTI_POLLUTION = 54,
309 AIS_TYPE_LAW_ENFORCEMENT = 55,
310 AIS_TYPE_SPARE_LOCAL_1 = 56,
311 AIS_TYPE_SPARE_LOCAL_2 = 57,
312 AIS_TYPE_MEDICAL_TRANSPORT = 58,
313 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
314 AIS_TYPE_NONECOMBATANT = 59,
315 AIS_TYPE_PASSENGER = 60,
316 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
317 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
318 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
319 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
320 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
321 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
322 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
323 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
324 AIS_TYPE_PASSENGER_UNKNOWN = 69,
325 AIS_TYPE_CARGO = 70,
326 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
327 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
328 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
329 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
330 AIS_TYPE_CARGO_RESERVED_1 = 75,
331 AIS_TYPE_CARGO_RESERVED_2 = 76,
332 AIS_TYPE_CARGO_RESERVED_3 = 77,
333 AIS_TYPE_CARGO_RESERVED_4 = 78,
334 AIS_TYPE_CARGO_UNKNOWN = 79,
335 AIS_TYPE_TANKER = 80,
336 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
337 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
338 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
339 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
340 AIS_TYPE_TANKER_RESERVED_1 = 85,
341 AIS_TYPE_TANKER_RESERVED_2 = 86,
342 AIS_TYPE_TANKER_RESERVED_3 = 87,
343 AIS_TYPE_TANKER_RESERVED_4 = 88,
344 AIS_TYPE_TANKER_UNKNOWN = 89,
345 AIS_TYPE_OTHER = 90,
346 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
347 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
348 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
349 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
350 AIS_TYPE_OTHER_RESERVED_1 = 95,
351 AIS_TYPE_OTHER_RESERVED_2 = 96,
352 AIS_TYPE_OTHER_RESERVED_3 = 97,
353 AIS_TYPE_OTHER_RESERVED_4 = 98,
354 AIS_TYPE_OTHER_UNKNOWN = 99,
355}
356impl AisType {
357 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
358}
359impl Default for AisType {
360 fn default() -> Self {
361 Self::DEFAULT
362 }
363}
364bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
365impl AttitudeTargetTypemask {
366 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
367}
368impl Default for AttitudeTargetTypemask {
369 fn default() -> Self {
370 Self::DEFAULT
371 }
372}
373#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
375#[cfg_attr(feature = "serde", serde(tag = "type"))]
376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
377#[repr(u32)]
378#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
379pub enum AutotuneAxis {
380 #[doc = "Autotune roll axis."]
381 AUTOTUNE_AXIS_ROLL = 1,
382 #[doc = "Autotune pitch axis."]
383 AUTOTUNE_AXIS_PITCH = 2,
384 #[doc = "Autotune yaw axis."]
385 AUTOTUNE_AXIS_YAW = 4,
386}
387impl AutotuneAxis {
388 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
389}
390impl Default for AutotuneAxis {
391 fn default() -> Self {
392 Self::DEFAULT
393 }
394}
395bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
396impl CameraCapFlags {
397 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
398}
399impl Default for CameraCapFlags {
400 fn default() -> Self {
401 Self::DEFAULT
402 }
403}
404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
406#[cfg_attr(feature = "serde", serde(tag = "type"))]
407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
408#[repr(u32)]
409#[doc = "Camera Modes."]
410pub enum CameraMode {
411 #[doc = "Camera is in image/photo capture mode."]
412 CAMERA_MODE_IMAGE = 0,
413 #[doc = "Camera is in video capture mode."]
414 CAMERA_MODE_VIDEO = 1,
415 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
416 CAMERA_MODE_IMAGE_SURVEY = 2,
417}
418impl CameraMode {
419 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
420}
421impl Default for CameraMode {
422 fn default() -> Self {
423 Self::DEFAULT
424 }
425}
426#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
428#[cfg_attr(feature = "serde", serde(tag = "type"))]
429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
430#[repr(u32)]
431#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
432pub enum CameraSource {
433 #[doc = "Default camera source."]
434 CAMERA_SOURCE_DEFAULT = 0,
435 #[doc = "RGB camera source."]
436 CAMERA_SOURCE_RGB = 1,
437 #[doc = "IR camera source."]
438 CAMERA_SOURCE_IR = 2,
439 #[doc = "NDVI camera source."]
440 CAMERA_SOURCE_NDVI = 3,
441}
442impl CameraSource {
443 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
444}
445impl Default for CameraSource {
446 fn default() -> Self {
447 Self::DEFAULT
448 }
449}
450#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
452#[cfg_attr(feature = "serde", serde(tag = "type"))]
453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
454#[repr(u32)]
455#[doc = "Camera tracking modes"]
456pub enum CameraTrackingMode {
457 #[doc = "Not tracking"]
458 CAMERA_TRACKING_MODE_NONE = 0,
459 #[doc = "Target is a point"]
460 CAMERA_TRACKING_MODE_POINT = 1,
461 #[doc = "Target is a rectangle"]
462 CAMERA_TRACKING_MODE_RECTANGLE = 2,
463}
464impl CameraTrackingMode {
465 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
466}
467impl Default for CameraTrackingMode {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking status flags"]
478pub enum CameraTrackingStatusFlags {
479 #[doc = "Camera is not tracking"]
480 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
481 #[doc = "Camera is tracking"]
482 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
483 #[doc = "Camera tracking in error state"]
484 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
485}
486impl CameraTrackingStatusFlags {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
488}
489impl Default for CameraTrackingStatusFlags {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
495impl CameraTrackingTargetData {
496 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
497}
498impl Default for CameraTrackingTargetData {
499 fn default() -> Self {
500 Self::DEFAULT
501 }
502}
503#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
505#[cfg_attr(feature = "serde", serde(tag = "type"))]
506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
507#[repr(u32)]
508#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
509pub enum CameraZoomType {
510 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
511 ZOOM_TYPE_STEP = 0,
512 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
513 ZOOM_TYPE_CONTINUOUS = 1,
514 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
515 ZOOM_TYPE_RANGE = 2,
516 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
517 ZOOM_TYPE_FOCAL_LENGTH = 3,
518 #[doc = "Zoom value as horizontal field of view in degrees."]
519 ZOOM_TYPE_HORIZONTAL_FOV = 4,
520}
521impl CameraZoomType {
522 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
523}
524impl Default for CameraZoomType {
525 fn default() -> Self {
526 Self::DEFAULT
527 }
528}
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534pub enum CanFilterOp {
535 CAN_FILTER_REPLACE = 0,
536 CAN_FILTER_ADD = 1,
537 CAN_FILTER_REMOVE = 2,
538}
539impl CanFilterOp {
540 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
541}
542impl Default for CanFilterOp {
543 fn default() -> Self {
544 Self::DEFAULT
545 }
546}
547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
549#[cfg_attr(feature = "serde", serde(tag = "type"))]
550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
551#[repr(u32)]
552#[doc = "Possible responses from a CELLULAR_CONFIG message."]
553pub enum CellularConfigResponse {
554 #[doc = "Changes accepted."]
555 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
556 #[doc = "Invalid APN."]
557 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
558 #[doc = "Invalid PIN."]
559 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
560 #[doc = "Changes rejected."]
561 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
562 #[doc = "PUK is required to unblock SIM card."]
563 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
564}
565impl CellularConfigResponse {
566 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
567}
568impl Default for CellularConfigResponse {
569 fn default() -> Self {
570 Self::DEFAULT
571 }
572}
573#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
575#[cfg_attr(feature = "serde", serde(tag = "type"))]
576#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
577#[repr(u32)]
578#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
579pub enum CellularNetworkFailedReason {
580 #[doc = "No error"]
581 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
582 #[doc = "Error state is unknown"]
583 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
584 #[doc = "SIM is required for the modem but missing"]
585 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
586 #[doc = "SIM is available, but not usable for connection"]
587 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
588}
589impl CellularNetworkFailedReason {
590 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
591}
592impl Default for CellularNetworkFailedReason {
593 fn default() -> Self {
594 Self::DEFAULT
595 }
596}
597#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
599#[cfg_attr(feature = "serde", serde(tag = "type"))]
600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
601#[repr(u32)]
602#[doc = "Cellular network radio type"]
603pub enum CellularNetworkRadioType {
604 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
605 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
606 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
607 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
608 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
609}
610impl CellularNetworkRadioType {
611 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
612}
613impl Default for CellularNetworkRadioType {
614 fn default() -> Self {
615 Self::DEFAULT
616 }
617}
618#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
620#[cfg_attr(feature = "serde", serde(tag = "type"))]
621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
622#[repr(u32)]
623#[doc = "These flags encode the cellular network status"]
624pub enum CellularStatusFlag {
625 #[doc = "State unknown or not reportable."]
626 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
627 #[doc = "Modem is unusable"]
628 CELLULAR_STATUS_FLAG_FAILED = 1,
629 #[doc = "Modem is being initialized"]
630 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
631 #[doc = "Modem is locked"]
632 CELLULAR_STATUS_FLAG_LOCKED = 3,
633 #[doc = "Modem is not enabled and is powered down"]
634 CELLULAR_STATUS_FLAG_DISABLED = 4,
635 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
636 CELLULAR_STATUS_FLAG_DISABLING = 5,
637 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
638 CELLULAR_STATUS_FLAG_ENABLING = 6,
639 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
640 CELLULAR_STATUS_FLAG_ENABLED = 7,
641 #[doc = "Modem is searching for a network provider to register"]
642 CELLULAR_STATUS_FLAG_SEARCHING = 8,
643 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
644 CELLULAR_STATUS_FLAG_REGISTERED = 9,
645 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
646 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
647 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
648 CELLULAR_STATUS_FLAG_CONNECTING = 11,
649 #[doc = "One or more packet data bearers is active and connected"]
650 CELLULAR_STATUS_FLAG_CONNECTED = 12,
651}
652impl CellularStatusFlag {
653 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
654}
655impl Default for CellularStatusFlag {
656 fn default() -> Self {
657 Self::DEFAULT
658 }
659}
660#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
662#[cfg_attr(feature = "serde", serde(tag = "type"))]
663#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
664#[repr(u32)]
665#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
666pub enum CompMetadataType {
667 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
668 COMP_METADATA_TYPE_GENERAL = 0,
669 #[doc = "Parameter meta data."]
670 COMP_METADATA_TYPE_PARAMETER = 1,
671 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
672 COMP_METADATA_TYPE_COMMANDS = 2,
673 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
674 COMP_METADATA_TYPE_PERIPHERALS = 3,
675 #[doc = "Meta data for the events interface."]
676 COMP_METADATA_TYPE_EVENTS = 4,
677 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
678 COMP_METADATA_TYPE_ACTUATORS = 5,
679}
680impl CompMetadataType {
681 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
682}
683impl Default for CompMetadataType {
684 fn default() -> Self {
685 Self::DEFAULT
686 }
687}
688#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
690#[cfg_attr(feature = "serde", serde(tag = "type"))]
691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
692#[repr(u32)]
693#[doc = "Indicates the ESC connection type."]
694pub enum EscConnectionType {
695 #[doc = "Traditional PPM ESC."]
696 ESC_CONNECTION_TYPE_PPM = 0,
697 #[doc = "Serial Bus connected ESC."]
698 ESC_CONNECTION_TYPE_SERIAL = 1,
699 #[doc = "One Shot PPM ESC."]
700 ESC_CONNECTION_TYPE_ONESHOT = 2,
701 #[doc = "I2C ESC."]
702 ESC_CONNECTION_TYPE_I2C = 3,
703 #[doc = "CAN-Bus ESC."]
704 ESC_CONNECTION_TYPE_CAN = 4,
705 #[doc = "DShot ESC."]
706 ESC_CONNECTION_TYPE_DSHOT = 5,
707}
708impl EscConnectionType {
709 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
710}
711impl Default for EscConnectionType {
712 fn default() -> Self {
713 Self::DEFAULT
714 }
715}
716bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
717impl EscFailureFlags {
718 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
719}
720impl Default for EscFailureFlags {
721 fn default() -> Self {
722 Self::DEFAULT
723 }
724}
725bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
726impl EstimatorStatusFlags {
727 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
728}
729impl Default for EstimatorStatusFlags {
730 fn default() -> Self {
731 Self::DEFAULT
732 }
733}
734#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
736#[cfg_attr(feature = "serde", serde(tag = "type"))]
737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
738#[repr(u32)]
739#[doc = "List of possible failure type to inject."]
740pub enum FailureType {
741 #[doc = "No failure injected, used to reset a previous failure."]
742 FAILURE_TYPE_OK = 0,
743 #[doc = "Sets unit off, so completely non-responsive."]
744 FAILURE_TYPE_OFF = 1,
745 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
746 FAILURE_TYPE_STUCK = 2,
747 #[doc = "Unit is reporting complete garbage."]
748 FAILURE_TYPE_GARBAGE = 3,
749 #[doc = "Unit is consistently wrong."]
750 FAILURE_TYPE_WRONG = 4,
751 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
752 FAILURE_TYPE_SLOW = 5,
753 #[doc = "Data of unit is delayed in time."]
754 FAILURE_TYPE_DELAYED = 6,
755 #[doc = "Unit is sometimes working, sometimes not."]
756 FAILURE_TYPE_INTERMITTENT = 7,
757}
758impl FailureType {
759 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
760}
761impl Default for FailureType {
762 fn default() -> Self {
763 Self::DEFAULT
764 }
765}
766#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
768#[cfg_attr(feature = "serde", serde(tag = "type"))]
769#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
770#[repr(u32)]
771#[doc = "List of possible units where failures can be injected."]
772pub enum FailureUnit {
773 FAILURE_UNIT_SENSOR_GYRO = 0,
774 FAILURE_UNIT_SENSOR_ACCEL = 1,
775 FAILURE_UNIT_SENSOR_MAG = 2,
776 FAILURE_UNIT_SENSOR_BARO = 3,
777 FAILURE_UNIT_SENSOR_GPS = 4,
778 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
779 FAILURE_UNIT_SENSOR_VIO = 6,
780 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
781 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
782 FAILURE_UNIT_SYSTEM_BATTERY = 100,
783 FAILURE_UNIT_SYSTEM_MOTOR = 101,
784 FAILURE_UNIT_SYSTEM_SERVO = 102,
785 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
786 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
787 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
788}
789impl FailureUnit {
790 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
791}
792impl Default for FailureUnit {
793 fn default() -> Self {
794 Self::DEFAULT
795 }
796}
797#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
799#[cfg_attr(feature = "serde", serde(tag = "type"))]
800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
801#[repr(u32)]
802pub enum FenceBreach {
803 #[doc = "No last fence breach"]
804 FENCE_BREACH_NONE = 0,
805 #[doc = "Breached minimum altitude"]
806 FENCE_BREACH_MINALT = 1,
807 #[doc = "Breached maximum altitude"]
808 FENCE_BREACH_MAXALT = 2,
809 #[doc = "Breached fence boundary"]
810 FENCE_BREACH_BOUNDARY = 3,
811}
812impl FenceBreach {
813 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
814}
815impl Default for FenceBreach {
816 fn default() -> Self {
817 Self::DEFAULT
818 }
819}
820#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
822#[cfg_attr(feature = "serde", serde(tag = "type"))]
823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
824#[repr(u32)]
825#[doc = "Actions being taken to mitigate/prevent fence breach"]
826pub enum FenceMitigate {
827 #[doc = "Unknown"]
828 FENCE_MITIGATE_UNKNOWN = 0,
829 #[doc = "No actions being taken"]
830 FENCE_MITIGATE_NONE = 1,
831 #[doc = "Velocity limiting active to prevent breach"]
832 FENCE_MITIGATE_VEL_LIMIT = 2,
833}
834impl FenceMitigate {
835 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
836}
837impl Default for FenceMitigate {
838 fn default() -> Self {
839 Self::DEFAULT
840 }
841}
842#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
844#[cfg_attr(feature = "serde", serde(tag = "type"))]
845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
846#[repr(u32)]
847#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
848pub enum FenceType {
849 #[doc = "Maximum altitude fence"]
850 FENCE_TYPE_ALT_MAX = 1,
851 #[doc = "Circle fence"]
852 FENCE_TYPE_CIRCLE = 2,
853 #[doc = "Polygon fence"]
854 FENCE_TYPE_POLYGON = 4,
855 #[doc = "Minimum altitude fence"]
856 FENCE_TYPE_ALT_MIN = 8,
857}
858impl FenceType {
859 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
860}
861impl Default for FenceType {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
868#[cfg_attr(feature = "serde", serde(tag = "type"))]
869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
870#[repr(u32)]
871#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
872pub enum FirmwareVersionType {
873 #[doc = "development release"]
874 FIRMWARE_VERSION_TYPE_DEV = 0,
875 #[doc = "alpha release"]
876 FIRMWARE_VERSION_TYPE_ALPHA = 64,
877 #[doc = "beta release"]
878 FIRMWARE_VERSION_TYPE_BETA = 128,
879 #[doc = "release candidate"]
880 FIRMWARE_VERSION_TYPE_RC = 192,
881 #[doc = "official stable release"]
882 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
883}
884impl FirmwareVersionType {
885 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
886}
887impl Default for FirmwareVersionType {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
893impl GimbalDeviceCapFlags {
894 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
895}
896impl Default for GimbalDeviceCapFlags {
897 fn default() -> Self {
898 Self::DEFAULT
899 }
900}
901bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
902impl GimbalDeviceErrorFlags {
903 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
904}
905impl Default for GimbalDeviceErrorFlags {
906 fn default() -> Self {
907 Self::DEFAULT
908 }
909}
910bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
911impl GimbalDeviceFlags {
912 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
913}
914impl Default for GimbalDeviceFlags {
915 fn default() -> Self {
916 Self::DEFAULT
917 }
918}
919bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
920impl GimbalManagerCapFlags {
921 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
922}
923impl Default for GimbalManagerCapFlags {
924 fn default() -> Self {
925 Self::DEFAULT
926 }
927}
928bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
929impl GimbalManagerFlags {
930 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
931}
932impl Default for GimbalManagerFlags {
933 fn default() -> Self {
934 Self::DEFAULT
935 }
936}
937#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
939#[cfg_attr(feature = "serde", serde(tag = "type"))]
940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
941#[repr(u32)]
942#[doc = "Type of GPS fix"]
943pub enum GpsFixType {
944 #[doc = "No GPS connected"]
945 GPS_FIX_TYPE_NO_GPS = 0,
946 #[doc = "No position information, GPS is connected"]
947 GPS_FIX_TYPE_NO_FIX = 1,
948 #[doc = "2D position"]
949 GPS_FIX_TYPE_2D_FIX = 2,
950 #[doc = "3D position"]
951 GPS_FIX_TYPE_3D_FIX = 3,
952 #[doc = "DGPS/SBAS aided 3D position"]
953 GPS_FIX_TYPE_DGPS = 4,
954 #[doc = "RTK float, 3D position"]
955 GPS_FIX_TYPE_RTK_FLOAT = 5,
956 #[doc = "RTK Fixed, 3D position"]
957 GPS_FIX_TYPE_RTK_FIXED = 6,
958 #[doc = "Static fixed, typically used for base stations"]
959 GPS_FIX_TYPE_STATIC = 7,
960 #[doc = "PPP, 3D position."]
961 GPS_FIX_TYPE_PPP = 8,
962}
963impl GpsFixType {
964 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
965}
966impl Default for GpsFixType {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
972impl GpsInputIgnoreFlags {
973 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
974}
975impl Default for GpsInputIgnoreFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
982#[cfg_attr(feature = "serde", serde(tag = "type"))]
983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
984#[repr(u32)]
985#[doc = "Gripper actions."]
986pub enum GripperActions {
987 #[doc = "Gripper release cargo."]
988 GRIPPER_ACTION_RELEASE = 0,
989 #[doc = "Gripper grab onto cargo."]
990 GRIPPER_ACTION_GRAB = 1,
991}
992impl GripperActions {
993 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
994}
995impl Default for GripperActions {
996 fn default() -> Self {
997 Self::DEFAULT
998 }
999}
1000bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1001impl HighresImuUpdatedFlags {
1002 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1003}
1004impl Default for HighresImuUpdatedFlags {
1005 fn default() -> Self {
1006 Self::DEFAULT
1007 }
1008}
1009bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1010impl HilActuatorControlsFlags {
1011 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1012}
1013impl Default for HilActuatorControlsFlags {
1014 fn default() -> Self {
1015 Self::DEFAULT
1016 }
1017}
1018bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1019impl HilSensorUpdatedFlags {
1020 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1021}
1022impl Default for HilSensorUpdatedFlags {
1023 fn default() -> Self {
1024 Self::DEFAULT
1025 }
1026}
1027bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1028impl HlFailureFlag {
1029 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1030}
1031impl Default for HlFailureFlag {
1032 fn default() -> Self {
1033 Self::DEFAULT
1034 }
1035}
1036bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1037impl IlluminatorErrorFlags {
1038 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1039}
1040impl Default for IlluminatorErrorFlags {
1041 fn default() -> Self {
1042 Self::DEFAULT
1043 }
1044}
1045#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1047#[cfg_attr(feature = "serde", serde(tag = "type"))]
1048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1049#[repr(u32)]
1050#[doc = "Modes of illuminator"]
1051pub enum IlluminatorMode {
1052 #[doc = "Illuminator mode is not specified/unknown"]
1053 ILLUMINATOR_MODE_UNKNOWN = 0,
1054 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1055 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1056 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1057 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1058}
1059impl IlluminatorMode {
1060 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1061}
1062impl Default for IlluminatorMode {
1063 fn default() -> Self {
1064 Self::DEFAULT
1065 }
1066}
1067#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1069#[cfg_attr(feature = "serde", serde(tag = "type"))]
1070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1071#[repr(u32)]
1072#[doc = "Type of landing target"]
1073pub enum LandingTargetType {
1074 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1075 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1076 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1077 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1078 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1079 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1080 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1081 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1082}
1083impl LandingTargetType {
1084 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1085}
1086impl Default for LandingTargetType {
1087 fn default() -> Self {
1088 Self::DEFAULT
1089 }
1090}
1091#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1093#[cfg_attr(feature = "serde", serde(tag = "type"))]
1094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1095#[repr(u32)]
1096pub enum MagCalStatus {
1097 MAG_CAL_NOT_STARTED = 0,
1098 MAG_CAL_WAITING_TO_START = 1,
1099 MAG_CAL_RUNNING_STEP_ONE = 2,
1100 MAG_CAL_RUNNING_STEP_TWO = 3,
1101 MAG_CAL_SUCCESS = 4,
1102 MAG_CAL_FAILED = 5,
1103 MAG_CAL_BAD_ORIENTATION = 6,
1104 MAG_CAL_BAD_RADIUS = 7,
1105}
1106impl MagCalStatus {
1107 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1108}
1109impl Default for MagCalStatus {
1110 fn default() -> Self {
1111 Self::DEFAULT
1112 }
1113}
1114#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1116#[cfg_attr(feature = "serde", serde(tag = "type"))]
1117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1118#[repr(u32)]
1119pub enum MavArmAuthDeniedReason {
1120 #[doc = "Not a specific reason"]
1121 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1122 #[doc = "Authorizer will send the error as string to GCS"]
1123 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1124 #[doc = "At least one waypoint have a invalid value"]
1125 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1126 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1127 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1128 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1129 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1130 #[doc = "Weather is not good to fly"]
1131 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1132}
1133impl MavArmAuthDeniedReason {
1134 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1135}
1136impl Default for MavArmAuthDeniedReason {
1137 fn default() -> Self {
1138 Self::DEFAULT
1139 }
1140}
1141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1143#[cfg_attr(feature = "serde", serde(tag = "type"))]
1144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1145#[repr(u32)]
1146#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1147pub enum MavAutopilot {
1148 #[doc = "Generic autopilot, full support for everything"]
1149 MAV_AUTOPILOT_GENERIC = 0,
1150 #[doc = "Reserved for future use."]
1151 MAV_AUTOPILOT_RESERVED = 1,
1152 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1153 MAV_AUTOPILOT_SLUGS = 2,
1154 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1155 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1156 #[doc = "OpenPilot, <http://openpilot.org>"]
1157 MAV_AUTOPILOT_OPENPILOT = 4,
1158 #[doc = "Generic autopilot only supporting simple waypoints"]
1159 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1160 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1161 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1162 #[doc = "Generic autopilot supporting the full mission command set"]
1163 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1164 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1165 MAV_AUTOPILOT_INVALID = 8,
1166 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1167 MAV_AUTOPILOT_PPZ = 9,
1168 #[doc = "UAV Dev Board"]
1169 MAV_AUTOPILOT_UDB = 10,
1170 #[doc = "FlexiPilot"]
1171 MAV_AUTOPILOT_FP = 11,
1172 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1173 MAV_AUTOPILOT_PX4 = 12,
1174 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1175 MAV_AUTOPILOT_SMACCMPILOT = 13,
1176 #[doc = "AutoQuad -- <http://autoquad.org>"]
1177 MAV_AUTOPILOT_AUTOQUAD = 14,
1178 #[doc = "Armazila -- <http://armazila.com>"]
1179 MAV_AUTOPILOT_ARMAZILA = 15,
1180 #[doc = "Aerob -- <http://aerob.ru>"]
1181 MAV_AUTOPILOT_AEROB = 16,
1182 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1183 MAV_AUTOPILOT_ASLUAV = 17,
1184 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1185 MAV_AUTOPILOT_SMARTAP = 18,
1186 #[doc = "AirRails - <http://uaventure.com>"]
1187 MAV_AUTOPILOT_AIRRAILS = 19,
1188 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1189 MAV_AUTOPILOT_REFLEX = 20,
1190}
1191impl MavAutopilot {
1192 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1193}
1194impl Default for MavAutopilot {
1195 fn default() -> Self {
1196 Self::DEFAULT
1197 }
1198}
1199#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1201#[cfg_attr(feature = "serde", serde(tag = "type"))]
1202#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1203#[repr(u32)]
1204#[doc = "Enumeration for battery charge states."]
1205pub enum MavBatteryChargeState {
1206 #[doc = "Low battery state is not provided"]
1207 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1208 #[doc = "Battery is not in low state. Normal operation."]
1209 MAV_BATTERY_CHARGE_STATE_OK = 1,
1210 #[doc = "Battery state is low, warn and monitor close."]
1211 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1212 #[doc = "Battery state is critical, return or abort immediately."]
1213 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1214 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1215 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1216 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1217 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1218 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1219 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1220 #[doc = "Battery is charging."]
1221 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1222}
1223impl MavBatteryChargeState {
1224 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1225}
1226impl Default for MavBatteryChargeState {
1227 fn default() -> Self {
1228 Self::DEFAULT
1229 }
1230}
1231bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1232impl MavBatteryFault {
1233 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1234}
1235impl Default for MavBatteryFault {
1236 fn default() -> Self {
1237 Self::DEFAULT
1238 }
1239}
1240#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1242#[cfg_attr(feature = "serde", serde(tag = "type"))]
1243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1244#[repr(u32)]
1245#[doc = "Enumeration of battery functions"]
1246pub enum MavBatteryFunction {
1247 #[doc = "Battery function is unknown"]
1248 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1249 #[doc = "Battery supports all flight systems"]
1250 MAV_BATTERY_FUNCTION_ALL = 1,
1251 #[doc = "Battery for the propulsion system"]
1252 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1253 #[doc = "Avionics battery"]
1254 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1255 #[doc = "Payload battery"]
1256 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1257}
1258impl MavBatteryFunction {
1259 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1260}
1261impl Default for MavBatteryFunction {
1262 fn default() -> Self {
1263 Self::DEFAULT
1264 }
1265}
1266#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1268#[cfg_attr(feature = "serde", serde(tag = "type"))]
1269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1270#[repr(u32)]
1271#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1272pub enum MavBatteryMode {
1273 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1274 MAV_BATTERY_MODE_UNKNOWN = 0,
1275 #[doc = "Battery is auto discharging (towards storage level)."]
1276 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1277 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1278 MAV_BATTERY_MODE_HOT_SWAP = 2,
1279}
1280impl MavBatteryMode {
1281 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1282}
1283impl Default for MavBatteryMode {
1284 fn default() -> Self {
1285 Self::DEFAULT
1286 }
1287}
1288#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1290#[cfg_attr(feature = "serde", serde(tag = "type"))]
1291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1292#[repr(u32)]
1293#[doc = "Enumeration of battery types"]
1294pub enum MavBatteryType {
1295 #[doc = "Not specified."]
1296 MAV_BATTERY_TYPE_UNKNOWN = 0,
1297 #[doc = "Lithium polymer battery"]
1298 MAV_BATTERY_TYPE_LIPO = 1,
1299 #[doc = "Lithium-iron-phosphate battery"]
1300 MAV_BATTERY_TYPE_LIFE = 2,
1301 #[doc = "Lithium-ION battery"]
1302 MAV_BATTERY_TYPE_LION = 3,
1303 #[doc = "Nickel metal hydride battery"]
1304 MAV_BATTERY_TYPE_NIMH = 4,
1305}
1306impl MavBatteryType {
1307 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1308}
1309impl Default for MavBatteryType {
1310 fn default() -> Self {
1311 Self::DEFAULT
1312 }
1313}
1314#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1316#[cfg_attr(feature = "serde", serde(tag = "type"))]
1317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1318#[repr(u32)]
1319#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1320pub enum MavCmd {
1321 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1322 MAV_CMD_NAV_WAYPOINT = 16,
1323 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1324 MAV_CMD_NAV_LOITER_UNLIM = 17,
1325 #[doc = "Loiter around this waypoint for X turns"]
1326 MAV_CMD_NAV_LOITER_TURNS = 18,
1327 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1328 MAV_CMD_NAV_LOITER_TIME = 19,
1329 #[doc = "Return to launch location"]
1330 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1331 #[doc = "Land at location."]
1332 MAV_CMD_NAV_LAND = 21,
1333 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1334 MAV_CMD_NAV_TAKEOFF = 22,
1335 #[doc = "Land at local position (local frame only)"]
1336 MAV_CMD_NAV_LAND_LOCAL = 23,
1337 #[doc = "Takeoff from local position (local frame only)"]
1338 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1339 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1340 MAV_CMD_NAV_FOLLOW = 25,
1341 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1342 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1343 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1344 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1345 #[doc = "Begin following a target"]
1346 MAV_CMD_DO_FOLLOW = 32,
1347 #[doc = "Reposition the MAV after a follow target command has been sent"]
1348 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1349 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1350 MAV_CMD_DO_ORBIT = 34,
1351 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1352 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1353 MAV_CMD_NAV_ROI = 80,
1354 #[doc = "Control autonomous path planning on the MAV."]
1355 MAV_CMD_NAV_PATHPLANNING = 81,
1356 #[doc = "Navigate to waypoint using a spline path."]
1357 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1358 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1359 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1360 #[doc = "Land using VTOL mode"]
1361 MAV_CMD_NAV_VTOL_LAND = 85,
1362 #[doc = "hand control over to an external controller"]
1363 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1364 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1365 MAV_CMD_NAV_DELAY = 93,
1366 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1367 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1368 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1369 MAV_CMD_NAV_LAST = 95,
1370 #[doc = "Delay mission state machine."]
1371 MAV_CMD_CONDITION_DELAY = 112,
1372 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1373 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1374 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1375 MAV_CMD_CONDITION_DISTANCE = 114,
1376 #[doc = "Reach a certain target angle."]
1377 MAV_CMD_CONDITION_YAW = 115,
1378 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1379 MAV_CMD_CONDITION_LAST = 159,
1380 #[doc = "Set system mode."]
1381 MAV_CMD_DO_SET_MODE = 176,
1382 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1383 MAV_CMD_DO_JUMP = 177,
1384 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1385 MAV_CMD_DO_CHANGE_SPEED = 178,
1386 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1387 MAV_CMD_DO_SET_HOME = 179,
1388 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1389 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1390 MAV_CMD_DO_SET_PARAMETER = 180,
1391 #[doc = "Set a relay to a condition."]
1392 MAV_CMD_DO_SET_RELAY = 181,
1393 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1394 MAV_CMD_DO_REPEAT_RELAY = 182,
1395 #[doc = "Set a servo to a desired PWM value."]
1396 MAV_CMD_DO_SET_SERVO = 183,
1397 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1398 MAV_CMD_DO_REPEAT_SERVO = 184,
1399 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1400 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1401 #[doc = "Change altitude set point."]
1402 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1403 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1404 MAV_CMD_DO_SET_ACTUATOR = 187,
1405 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1406 MAV_CMD_DO_RETURN_PATH_START = 188,
1407 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1408 MAV_CMD_DO_LAND_START = 189,
1409 #[doc = "Mission command to perform a landing from a rally point."]
1410 MAV_CMD_DO_RALLY_LAND = 190,
1411 #[doc = "Mission command to safely abort an autonomous landing."]
1412 MAV_CMD_DO_GO_AROUND = 191,
1413 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1414 MAV_CMD_DO_REPOSITION = 192,
1415 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1416 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1417 #[doc = "Set moving direction to forward or reverse."]
1418 MAV_CMD_DO_SET_REVERSE = 194,
1419 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1420 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1421 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1422 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1423 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1424 MAV_CMD_DO_SET_ROI_NONE = 197,
1425 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1426 MAV_CMD_DO_SET_ROI_SYSID = 198,
1427 #[doc = "Control onboard camera system."]
1428 MAV_CMD_DO_CONTROL_VIDEO = 200,
1429 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1430 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1431 MAV_CMD_DO_SET_ROI = 201,
1432 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1433 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1434 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1435 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1436 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1437 #[doc = "Mission command to configure a camera or antenna mount"]
1438 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1439 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1440 #[doc = "Mission command to control a camera or antenna mount"]
1441 MAV_CMD_DO_MOUNT_CONTROL = 205,
1442 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1443 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1444 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1445 MAV_CMD_DO_FENCE_ENABLE = 207,
1446 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1447 MAV_CMD_DO_PARACHUTE = 208,
1448 #[doc = "Command to perform motor test."]
1449 MAV_CMD_DO_MOTOR_TEST = 209,
1450 #[doc = "Change to/from inverted flight."]
1451 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1452 #[doc = "Mission command to operate a gripper."]
1453 MAV_CMD_DO_GRIPPER = 211,
1454 #[doc = "Enable/disable autotune."]
1455 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1456 #[doc = "Sets a desired vehicle turn angle and speed change."]
1457 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1458 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1459 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1460 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1461 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1462 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1463 #[doc = "set id of master controller"]
1464 MAV_CMD_DO_GUIDED_MASTER = 221,
1465 #[doc = "Set limits for external control"]
1466 MAV_CMD_DO_GUIDED_LIMITS = 222,
1467 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1468 MAV_CMD_DO_ENGINE_CONTROL = 223,
1469 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1470 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1471 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1472 MAV_CMD_DO_LAST = 240,
1473 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1474 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1475 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1476 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1477 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1478 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1479 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1480 MAV_CMD_PREFLIGHT_STORAGE = 245,
1481 #[doc = "Request the reboot or shutdown of system components."]
1482 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1483 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1484 MAV_CMD_OVERRIDE_GOTO = 252,
1485 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1486 MAV_CMD_OBLIQUE_SURVEY = 260,
1487 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1488 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1489 #[doc = "start running a mission"]
1490 MAV_CMD_MISSION_START = 300,
1491 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1492 MAV_CMD_ACTUATOR_TEST = 310,
1493 #[doc = "Actuator configuration command."]
1494 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1495 #[doc = "Arms / Disarms a component"]
1496 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1497 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1498 MAV_CMD_RUN_PREARM_CHECKS = 401,
1499 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1500 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1501 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1502 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1503 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1504 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1505 MAV_CMD_GET_HOME_POSITION = 410,
1506 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1507 MAV_CMD_INJECT_FAILURE = 420,
1508 #[doc = "Starts receiver pairing."]
1509 MAV_CMD_START_RX_PAIR = 500,
1510 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1511 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1512 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1513 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1514 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1515 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1516 MAV_CMD_REQUEST_MESSAGE = 512,
1517 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1518 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1519 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1520 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1521 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1522 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1523 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1524 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1525 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1526 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1527 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1528 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1529 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1530 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1531 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1532 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1533 MAV_CMD_STORAGE_FORMAT = 526,
1534 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1535 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1536 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1537 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1538 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1539 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1540 #[doc = "Reset all camera settings to Factory Default"]
1541 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1542 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1543 MAV_CMD_SET_CAMERA_MODE = 530,
1544 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1545 MAV_CMD_SET_CAMERA_ZOOM = 531,
1546 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1547 MAV_CMD_SET_CAMERA_FOCUS = 532,
1548 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1549 MAV_CMD_SET_STORAGE_USAGE = 533,
1550 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1551 MAV_CMD_SET_CAMERA_SOURCE = 534,
1552 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1553 MAV_CMD_JUMP_TAG = 600,
1554 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1555 MAV_CMD_DO_JUMP_TAG = 601,
1556 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1557 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1558 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1559 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1560 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1561 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1562 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1563 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1564 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1565 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1566 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1567 #[doc = "Enable or disable on-board camera triggering system."]
1568 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1569 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1570 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1571 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1572 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1573 #[doc = "Stops ongoing tracking."]
1574 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1575 #[doc = "Starts video capture (recording)."]
1576 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1577 #[doc = "Stop the current video capture (recording)."]
1578 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1579 #[doc = "Start video streaming"]
1580 MAV_CMD_VIDEO_START_STREAMING = 2502,
1581 #[doc = "Stop the given video stream"]
1582 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1583 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1584 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1585 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1587 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1588 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1589 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1590 MAV_CMD_LOGGING_START = 2510,
1591 #[doc = "Request to stop streaming log data over MAVLink"]
1592 MAV_CMD_LOGGING_STOP = 2511,
1593 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1594 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1595 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1596 #[doc = "Create a panorama at the current position"]
1597 MAV_CMD_PANORAMA_CREATE = 2800,
1598 #[doc = "Request VTOL transition"]
1599 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1600 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1601 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1602 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1603 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1604 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1605 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1606 #[doc = "Delay mission state machine until gate has been reached."]
1607 MAV_CMD_CONDITION_GATE = 4501,
1608 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1609 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1610 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1611 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1612 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1613 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1614 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1615 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1616 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1617 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1618 #[doc = "Rally point. You can have multiple rally points defined."]
1619 MAV_CMD_NAV_RALLY_POINT = 5100,
1620 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1621 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1622 #[doc = "Change state of safety switch."]
1623 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1624 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1625 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1626 #[deprecated = " (Deprecated since 2021-06)"]
1627 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1628 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1629 #[deprecated = " (Deprecated since 2021-06)"]
1630 #[doc = "Control the payload deployment."]
1631 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1632 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1633 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1634 #[doc = "Command to operate winch."]
1635 MAV_CMD_DO_WINCH = 42600,
1636 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1637 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1638 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1639 MAV_CMD_WAYPOINT_USER_1 = 31000,
1640 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1641 MAV_CMD_WAYPOINT_USER_2 = 31001,
1642 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1643 MAV_CMD_WAYPOINT_USER_3 = 31002,
1644 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1645 MAV_CMD_WAYPOINT_USER_4 = 31003,
1646 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1647 MAV_CMD_WAYPOINT_USER_5 = 31004,
1648 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1649 MAV_CMD_SPATIAL_USER_1 = 31005,
1650 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1651 MAV_CMD_SPATIAL_USER_2 = 31006,
1652 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1653 MAV_CMD_SPATIAL_USER_3 = 31007,
1654 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1655 MAV_CMD_SPATIAL_USER_4 = 31008,
1656 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1657 MAV_CMD_SPATIAL_USER_5 = 31009,
1658 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1659 MAV_CMD_USER_1 = 31010,
1660 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1661 MAV_CMD_USER_2 = 31011,
1662 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1663 MAV_CMD_USER_3 = 31012,
1664 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1665 MAV_CMD_USER_4 = 31013,
1666 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1667 MAV_CMD_USER_5 = 31014,
1668 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1669 MAV_CMD_CAN_FORWARD = 32000,
1670}
1671impl MavCmd {
1672 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1673}
1674impl Default for MavCmd {
1675 fn default() -> Self {
1676 Self::DEFAULT
1677 }
1678}
1679#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1681#[cfg_attr(feature = "serde", serde(tag = "type"))]
1682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1683#[repr(u32)]
1684#[doc = "Possible actions an aircraft can take to avoid a collision."]
1685pub enum MavCollisionAction {
1686 #[doc = "Ignore any potential collisions"]
1687 MAV_COLLISION_ACTION_NONE = 0,
1688 #[doc = "Report potential collision"]
1689 MAV_COLLISION_ACTION_REPORT = 1,
1690 #[doc = "Ascend or Descend to avoid threat"]
1691 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1692 #[doc = "Move horizontally to avoid threat"]
1693 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1694 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1695 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1696 #[doc = "Aircraft to fly directly back to its launch point"]
1697 MAV_COLLISION_ACTION_RTL = 5,
1698 #[doc = "Aircraft to stop in place"]
1699 MAV_COLLISION_ACTION_HOVER = 6,
1700}
1701impl MavCollisionAction {
1702 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1703}
1704impl Default for MavCollisionAction {
1705 fn default() -> Self {
1706 Self::DEFAULT
1707 }
1708}
1709#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1711#[cfg_attr(feature = "serde", serde(tag = "type"))]
1712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1713#[repr(u32)]
1714#[doc = "Source of information about this collision."]
1715pub enum MavCollisionSrc {
1716 #[doc = "ID field references ADSB_VEHICLE packets"]
1717 MAV_COLLISION_SRC_ADSB = 0,
1718 #[doc = "ID field references MAVLink SRC ID"]
1719 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1720}
1721impl MavCollisionSrc {
1722 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1723}
1724impl Default for MavCollisionSrc {
1725 fn default() -> Self {
1726 Self::DEFAULT
1727 }
1728}
1729#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1731#[cfg_attr(feature = "serde", serde(tag = "type"))]
1732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1733#[repr(u32)]
1734#[doc = "Aircraft-rated danger from this threat."]
1735pub enum MavCollisionThreatLevel {
1736 #[doc = "Not a threat"]
1737 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1738 #[doc = "Craft is mildly concerned about this threat"]
1739 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1740 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1741 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1742}
1743impl MavCollisionThreatLevel {
1744 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1745}
1746impl Default for MavCollisionThreatLevel {
1747 fn default() -> Self {
1748 Self::DEFAULT
1749 }
1750}
1751#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1753#[cfg_attr(feature = "serde", serde(tag = "type"))]
1754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1755#[repr(u32)]
1756#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1757pub enum MavComponent {
1758 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1759 MAV_COMP_ID_ALL = 0,
1760 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1761 MAV_COMP_ID_AUTOPILOT1 = 1,
1762 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1763 MAV_COMP_ID_USER1 = 25,
1764 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1765 MAV_COMP_ID_USER2 = 26,
1766 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1767 MAV_COMP_ID_USER3 = 27,
1768 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1769 MAV_COMP_ID_USER4 = 28,
1770 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1771 MAV_COMP_ID_USER5 = 29,
1772 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1773 MAV_COMP_ID_USER6 = 30,
1774 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1775 MAV_COMP_ID_USER7 = 31,
1776 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1777 MAV_COMP_ID_USER8 = 32,
1778 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1779 MAV_COMP_ID_USER9 = 33,
1780 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1781 MAV_COMP_ID_USER10 = 34,
1782 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1783 MAV_COMP_ID_USER11 = 35,
1784 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1785 MAV_COMP_ID_USER12 = 36,
1786 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1787 MAV_COMP_ID_USER13 = 37,
1788 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1789 MAV_COMP_ID_USER14 = 38,
1790 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1791 MAV_COMP_ID_USER15 = 39,
1792 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1793 MAV_COMP_ID_USER16 = 40,
1794 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1795 MAV_COMP_ID_USER17 = 41,
1796 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1797 MAV_COMP_ID_USER18 = 42,
1798 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1799 MAV_COMP_ID_USER19 = 43,
1800 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1801 MAV_COMP_ID_USER20 = 44,
1802 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1803 MAV_COMP_ID_USER21 = 45,
1804 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1805 MAV_COMP_ID_USER22 = 46,
1806 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1807 MAV_COMP_ID_USER23 = 47,
1808 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1809 MAV_COMP_ID_USER24 = 48,
1810 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1811 MAV_COMP_ID_USER25 = 49,
1812 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1813 MAV_COMP_ID_USER26 = 50,
1814 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1815 MAV_COMP_ID_USER27 = 51,
1816 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1817 MAV_COMP_ID_USER28 = 52,
1818 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1819 MAV_COMP_ID_USER29 = 53,
1820 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1821 MAV_COMP_ID_USER30 = 54,
1822 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1823 MAV_COMP_ID_USER31 = 55,
1824 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1825 MAV_COMP_ID_USER32 = 56,
1826 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1827 MAV_COMP_ID_USER33 = 57,
1828 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1829 MAV_COMP_ID_USER34 = 58,
1830 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1831 MAV_COMP_ID_USER35 = 59,
1832 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1833 MAV_COMP_ID_USER36 = 60,
1834 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1835 MAV_COMP_ID_USER37 = 61,
1836 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1837 MAV_COMP_ID_USER38 = 62,
1838 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1839 MAV_COMP_ID_USER39 = 63,
1840 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1841 MAV_COMP_ID_USER40 = 64,
1842 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1843 MAV_COMP_ID_USER41 = 65,
1844 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1845 MAV_COMP_ID_USER42 = 66,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER43 = 67,
1848 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1849 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER45 = 69,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER46 = 70,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER47 = 71,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER48 = 72,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER49 = 73,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER50 = 74,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER51 = 75,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER52 = 76,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER53 = 77,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER54 = 78,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER55 = 79,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER56 = 80,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER57 = 81,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER58 = 82,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER59 = 83,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER60 = 84,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER61 = 85,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER62 = 86,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER63 = 87,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER64 = 88,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER65 = 89,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER66 = 90,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER67 = 91,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER68 = 92,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER69 = 93,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER70 = 94,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER71 = 95,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER72 = 96,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER73 = 97,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER74 = 98,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER75 = 99,
1912 #[doc = "Camera #1."]
1913 MAV_COMP_ID_CAMERA = 100,
1914 #[doc = "Camera #2."]
1915 MAV_COMP_ID_CAMERA2 = 101,
1916 #[doc = "Camera #3."]
1917 MAV_COMP_ID_CAMERA3 = 102,
1918 #[doc = "Camera #4."]
1919 MAV_COMP_ID_CAMERA4 = 103,
1920 #[doc = "Camera #5."]
1921 MAV_COMP_ID_CAMERA5 = 104,
1922 #[doc = "Camera #6."]
1923 MAV_COMP_ID_CAMERA6 = 105,
1924 #[doc = "Servo #1."]
1925 MAV_COMP_ID_SERVO1 = 140,
1926 #[doc = "Servo #2."]
1927 MAV_COMP_ID_SERVO2 = 141,
1928 #[doc = "Servo #3."]
1929 MAV_COMP_ID_SERVO3 = 142,
1930 #[doc = "Servo #4."]
1931 MAV_COMP_ID_SERVO4 = 143,
1932 #[doc = "Servo #5."]
1933 MAV_COMP_ID_SERVO5 = 144,
1934 #[doc = "Servo #6."]
1935 MAV_COMP_ID_SERVO6 = 145,
1936 #[doc = "Servo #7."]
1937 MAV_COMP_ID_SERVO7 = 146,
1938 #[doc = "Servo #8."]
1939 MAV_COMP_ID_SERVO8 = 147,
1940 #[doc = "Servo #9."]
1941 MAV_COMP_ID_SERVO9 = 148,
1942 #[doc = "Servo #10."]
1943 MAV_COMP_ID_SERVO10 = 149,
1944 #[doc = "Servo #11."]
1945 MAV_COMP_ID_SERVO11 = 150,
1946 #[doc = "Servo #12."]
1947 MAV_COMP_ID_SERVO12 = 151,
1948 #[doc = "Servo #13."]
1949 MAV_COMP_ID_SERVO13 = 152,
1950 #[doc = "Servo #14."]
1951 MAV_COMP_ID_SERVO14 = 153,
1952 #[doc = "Gimbal #1."]
1953 MAV_COMP_ID_GIMBAL = 154,
1954 #[doc = "Logging component."]
1955 MAV_COMP_ID_LOG = 155,
1956 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
1957 MAV_COMP_ID_ADSB = 156,
1958 #[doc = "On Screen Display (OSD) devices for video links."]
1959 MAV_COMP_ID_OSD = 157,
1960 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
1961 MAV_COMP_ID_PERIPHERAL = 158,
1962 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
1963 #[doc = "Gimbal ID for QX1."]
1964 MAV_COMP_ID_QX1_GIMBAL = 159,
1965 #[doc = "FLARM collision alert component."]
1966 MAV_COMP_ID_FLARM = 160,
1967 #[doc = "Parachute component."]
1968 MAV_COMP_ID_PARACHUTE = 161,
1969 #[doc = "Winch component."]
1970 MAV_COMP_ID_WINCH = 169,
1971 #[doc = "Gimbal #2."]
1972 MAV_COMP_ID_GIMBAL2 = 171,
1973 #[doc = "Gimbal #3."]
1974 MAV_COMP_ID_GIMBAL3 = 172,
1975 #[doc = "Gimbal #4"]
1976 MAV_COMP_ID_GIMBAL4 = 173,
1977 #[doc = "Gimbal #5."]
1978 MAV_COMP_ID_GIMBAL5 = 174,
1979 #[doc = "Gimbal #6."]
1980 MAV_COMP_ID_GIMBAL6 = 175,
1981 #[doc = "Battery #1."]
1982 MAV_COMP_ID_BATTERY = 180,
1983 #[doc = "Battery #2."]
1984 MAV_COMP_ID_BATTERY2 = 181,
1985 #[doc = "CAN over MAVLink client."]
1986 MAV_COMP_ID_MAVCAN = 189,
1987 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
1988 MAV_COMP_ID_MISSIONPLANNER = 190,
1989 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1990 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
1991 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1992 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
1993 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1994 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
1995 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1996 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
1997 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
1998 MAV_COMP_ID_PATHPLANNER = 195,
1999 #[doc = "Component that plans a collision free path between two points."]
2000 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2001 #[doc = "Component that provides position estimates using VIO techniques."]
2002 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2003 #[doc = "Component that manages pairing of vehicle and GCS."]
2004 MAV_COMP_ID_PAIRING_MANAGER = 198,
2005 #[doc = "Inertial Measurement Unit (IMU) #1."]
2006 MAV_COMP_ID_IMU = 200,
2007 #[doc = "Inertial Measurement Unit (IMU) #2."]
2008 MAV_COMP_ID_IMU_2 = 201,
2009 #[doc = "Inertial Measurement Unit (IMU) #3."]
2010 MAV_COMP_ID_IMU_3 = 202,
2011 #[doc = "GPS #1."]
2012 MAV_COMP_ID_GPS = 220,
2013 #[doc = "GPS #2."]
2014 MAV_COMP_ID_GPS2 = 221,
2015 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2016 MAV_COMP_ID_ODID_TXRX_1 = 236,
2017 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2018 MAV_COMP_ID_ODID_TXRX_2 = 237,
2019 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2020 MAV_COMP_ID_ODID_TXRX_3 = 238,
2021 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2022 MAV_COMP_ID_UDP_BRIDGE = 240,
2023 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2024 MAV_COMP_ID_UART_BRIDGE = 241,
2025 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2026 MAV_COMP_ID_TUNNEL_NODE = 242,
2027 #[doc = "Illuminator"]
2028 MAV_COMP_ID_ILLUMINATOR = 243,
2029 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2030 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2031 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2032}
2033impl MavComponent {
2034 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2035}
2036impl Default for MavComponent {
2037 fn default() -> Self {
2038 Self::DEFAULT
2039 }
2040}
2041#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2043#[cfg_attr(feature = "serde", serde(tag = "type"))]
2044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2045#[repr(u32)]
2046#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2047#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2048pub enum MavDataStream {
2049 #[doc = "Enable all data streams"]
2050 MAV_DATA_STREAM_ALL = 0,
2051 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2052 MAV_DATA_STREAM_RAW_SENSORS = 1,
2053 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2054 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2055 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2056 MAV_DATA_STREAM_RC_CHANNELS = 3,
2057 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2058 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2059 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2060 MAV_DATA_STREAM_POSITION = 6,
2061 #[doc = "Dependent on the autopilot"]
2062 MAV_DATA_STREAM_EXTRA1 = 10,
2063 #[doc = "Dependent on the autopilot"]
2064 MAV_DATA_STREAM_EXTRA2 = 11,
2065 #[doc = "Dependent on the autopilot"]
2066 MAV_DATA_STREAM_EXTRA3 = 12,
2067}
2068impl MavDataStream {
2069 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2070}
2071impl Default for MavDataStream {
2072 fn default() -> Self {
2073 Self::DEFAULT
2074 }
2075}
2076#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2078#[cfg_attr(feature = "serde", serde(tag = "type"))]
2079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2080#[repr(u32)]
2081#[doc = "Enumeration of distance sensor types"]
2082pub enum MavDistanceSensor {
2083 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2084 MAV_DISTANCE_SENSOR_LASER = 0,
2085 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2086 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2087 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2088 MAV_DISTANCE_SENSOR_INFRARED = 2,
2089 #[doc = "Radar type, e.g. uLanding units"]
2090 MAV_DISTANCE_SENSOR_RADAR = 3,
2091 #[doc = "Broken or unknown type, e.g. analog units"]
2092 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2093}
2094impl MavDistanceSensor {
2095 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2096}
2097impl Default for MavDistanceSensor {
2098 fn default() -> Self {
2099 Self::DEFAULT
2100 }
2101}
2102#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2103#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2104#[cfg_attr(feature = "serde", serde(tag = "type"))]
2105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2106#[repr(u32)]
2107#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2108pub enum MavDoRepositionFlags {
2109 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2110 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2111}
2112impl MavDoRepositionFlags {
2113 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2114}
2115impl Default for MavDoRepositionFlags {
2116 fn default() -> Self {
2117 Self::DEFAULT
2118 }
2119}
2120#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2121#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2122#[cfg_attr(feature = "serde", serde(tag = "type"))]
2123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2124#[repr(u32)]
2125#[doc = "Enumeration of estimator types"]
2126pub enum MavEstimatorType {
2127 #[doc = "Unknown type of the estimator."]
2128 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2129 #[doc = "This is a naive estimator without any real covariance feedback."]
2130 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2131 #[doc = "Computer vision based estimate. Might be up to scale."]
2132 MAV_ESTIMATOR_TYPE_VISION = 2,
2133 #[doc = "Visual-inertial estimate."]
2134 MAV_ESTIMATOR_TYPE_VIO = 3,
2135 #[doc = "Plain GPS estimate."]
2136 MAV_ESTIMATOR_TYPE_GPS = 4,
2137 #[doc = "Estimator integrating GPS and inertial sensing."]
2138 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2139 #[doc = "Estimate from external motion capturing system."]
2140 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2141 #[doc = "Estimator based on lidar sensor input."]
2142 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2143 #[doc = "Estimator on autopilot."]
2144 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2145}
2146impl MavEstimatorType {
2147 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2148}
2149impl Default for MavEstimatorType {
2150 fn default() -> Self {
2151 Self::DEFAULT
2152 }
2153}
2154#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2156#[cfg_attr(feature = "serde", serde(tag = "type"))]
2157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2158#[repr(u32)]
2159#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2160pub enum MavEventCurrentSequenceFlags {
2161 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2162 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2163}
2164impl MavEventCurrentSequenceFlags {
2165 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2166}
2167impl Default for MavEventCurrentSequenceFlags {
2168 fn default() -> Self {
2169 Self::DEFAULT
2170 }
2171}
2172#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2173#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2174#[cfg_attr(feature = "serde", serde(tag = "type"))]
2175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2176#[repr(u32)]
2177#[doc = "Reason for an event error response."]
2178pub enum MavEventErrorReason {
2179 #[doc = "The requested event is not available (anymore)."]
2180 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2181}
2182impl MavEventErrorReason {
2183 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2184}
2185impl Default for MavEventErrorReason {
2186 fn default() -> Self {
2187 Self::DEFAULT
2188 }
2189}
2190#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2192#[cfg_attr(feature = "serde", serde(tag = "type"))]
2193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2194#[repr(u32)]
2195#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2196pub enum MavFrame {
2197 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2198 MAV_FRAME_GLOBAL = 0,
2199 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2200 MAV_FRAME_LOCAL_NED = 1,
2201 #[doc = "NOT a coordinate frame, indicates a mission command."]
2202 MAV_FRAME_MISSION = 2,
2203 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2204 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2205 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2206 MAV_FRAME_LOCAL_ENU = 4,
2207 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2208 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2209 MAV_FRAME_GLOBAL_INT = 5,
2210 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2211 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2212 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2213 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2214 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2215 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2216 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2217 MAV_FRAME_BODY_NED = 8,
2218 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2219 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2220 MAV_FRAME_BODY_OFFSET_NED = 9,
2221 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2222 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2223 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2224 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2225 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2226 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2227 MAV_FRAME_BODY_FRD = 12,
2228 #[deprecated = " (Deprecated since 2019-04)"]
2229 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2230 MAV_FRAME_RESERVED_13 = 13,
2231 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2232 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2233 MAV_FRAME_RESERVED_14 = 14,
2234 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2235 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2236 MAV_FRAME_RESERVED_15 = 15,
2237 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2238 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2239 MAV_FRAME_RESERVED_16 = 16,
2240 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2241 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2242 MAV_FRAME_RESERVED_17 = 17,
2243 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2244 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2245 MAV_FRAME_RESERVED_18 = 18,
2246 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2247 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2248 MAV_FRAME_RESERVED_19 = 19,
2249 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2250 MAV_FRAME_LOCAL_FRD = 20,
2251 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2252 MAV_FRAME_LOCAL_FLU = 21,
2253}
2254impl MavFrame {
2255 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2256}
2257impl Default for MavFrame {
2258 fn default() -> Self {
2259 Self::DEFAULT
2260 }
2261}
2262#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2264#[cfg_attr(feature = "serde", serde(tag = "type"))]
2265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2266#[repr(u32)]
2267#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2268pub enum MavFtpErr {
2269 #[doc = "None: No error"]
2270 MAV_FTP_ERR_NONE = 0,
2271 #[doc = "Fail: Unknown failure"]
2272 MAV_FTP_ERR_FAIL = 1,
2273 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2274 MAV_FTP_ERR_FAILERRNO = 2,
2275 #[doc = "InvalidDataSize: Payload size is invalid"]
2276 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2277 #[doc = "InvalidSession: Session is not currently open"]
2278 MAV_FTP_ERR_INVALIDSESSION = 4,
2279 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2280 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2281 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2282 MAV_FTP_ERR_EOF = 6,
2283 #[doc = "UnknownCommand: Unknown command / opcode"]
2284 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2285 #[doc = "FileExists: File/directory already exists"]
2286 MAV_FTP_ERR_FILEEXISTS = 8,
2287 #[doc = "FileProtected: File/directory is write protected"]
2288 MAV_FTP_ERR_FILEPROTECTED = 9,
2289 #[doc = "FileNotFound: File/directory not found"]
2290 MAV_FTP_ERR_FILENOTFOUND = 10,
2291}
2292impl MavFtpErr {
2293 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2294}
2295impl Default for MavFtpErr {
2296 fn default() -> Self {
2297 Self::DEFAULT
2298 }
2299}
2300#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2302#[cfg_attr(feature = "serde", serde(tag = "type"))]
2303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2304#[repr(u32)]
2305#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2306pub enum MavFtpOpcode {
2307 #[doc = "None. Ignored, always ACKed"]
2308 MAV_FTP_OPCODE_NONE = 0,
2309 #[doc = "TerminateSession: Terminates open Read session"]
2310 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2311 #[doc = "ResetSessions: Terminates all open read sessions"]
2312 MAV_FTP_OPCODE_RESETSESSION = 2,
2313 #[doc = "ListDirectory. List files and directories in path from offset"]
2314 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2315 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2316 MAV_FTP_OPCODE_OPENFILERO = 4,
2317 #[doc = "ReadFile: Reads size bytes from offset in session"]
2318 MAV_FTP_OPCODE_READFILE = 5,
2319 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2320 MAV_FTP_OPCODE_CREATEFILE = 6,
2321 #[doc = "WriteFile: Writes size bytes to offset in session"]
2322 MAV_FTP_OPCODE_WRITEFILE = 7,
2323 #[doc = "RemoveFile: Remove file at path"]
2324 MAV_FTP_OPCODE_REMOVEFILE = 8,
2325 #[doc = "CreateDirectory: Creates directory at path"]
2326 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2327 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2328 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2329 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2330 MAV_FTP_OPCODE_OPENFILEWO = 11,
2331 #[doc = "TruncateFile: Truncate file at path to offset length"]
2332 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2333 #[doc = "Rename: Rename path1 to path2"]
2334 MAV_FTP_OPCODE_RENAME = 13,
2335 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2336 MAV_FTP_OPCODE_CALCFILECRC = 14,
2337 #[doc = "BurstReadFile: Burst download session file"]
2338 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2339 #[doc = "ACK: ACK response"]
2340 MAV_FTP_OPCODE_ACK = 128,
2341 #[doc = "NAK: NAK response"]
2342 MAV_FTP_OPCODE_NAK = 129,
2343}
2344impl MavFtpOpcode {
2345 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2346}
2347impl Default for MavFtpOpcode {
2348 fn default() -> Self {
2349 Self::DEFAULT
2350 }
2351}
2352#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2354#[cfg_attr(feature = "serde", serde(tag = "type"))]
2355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2356#[repr(u32)]
2357#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2358pub enum MavFuelType {
2359 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2360 MAV_FUEL_TYPE_UNKNOWN = 0,
2361 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2362 MAV_FUEL_TYPE_LIQUID = 1,
2363 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2364 MAV_FUEL_TYPE_GAS = 2,
2365}
2366impl MavFuelType {
2367 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2368}
2369impl Default for MavFuelType {
2370 fn default() -> Self {
2371 Self::DEFAULT
2372 }
2373}
2374bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2375impl MavGeneratorStatusFlag {
2376 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2377}
2378impl Default for MavGeneratorStatusFlag {
2379 fn default() -> Self {
2380 Self::DEFAULT
2381 }
2382}
2383#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2385#[cfg_attr(feature = "serde", serde(tag = "type"))]
2386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2387#[repr(u32)]
2388#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2389pub enum MavGoto {
2390 #[doc = "Hold at the current position."]
2391 MAV_GOTO_DO_HOLD = 0,
2392 #[doc = "Continue with the next item in mission execution."]
2393 MAV_GOTO_DO_CONTINUE = 1,
2394 #[doc = "Hold at the current position of the system"]
2395 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2396 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2397 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2398}
2399impl MavGoto {
2400 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2401}
2402impl Default for MavGoto {
2403 fn default() -> Self {
2404 Self::DEFAULT
2405 }
2406}
2407#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2409#[cfg_attr(feature = "serde", serde(tag = "type"))]
2410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2411#[repr(u32)]
2412#[doc = "Enumeration of landed detector states"]
2413pub enum MavLandedState {
2414 #[doc = "MAV landed state is unknown"]
2415 MAV_LANDED_STATE_UNDEFINED = 0,
2416 #[doc = "MAV is landed (on ground)"]
2417 MAV_LANDED_STATE_ON_GROUND = 1,
2418 #[doc = "MAV is in air"]
2419 MAV_LANDED_STATE_IN_AIR = 2,
2420 #[doc = "MAV currently taking off"]
2421 MAV_LANDED_STATE_TAKEOFF = 3,
2422 #[doc = "MAV currently landing"]
2423 MAV_LANDED_STATE_LANDING = 4,
2424}
2425impl MavLandedState {
2426 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2427}
2428impl Default for MavLandedState {
2429 fn default() -> Self {
2430 Self::DEFAULT
2431 }
2432}
2433#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2435#[cfg_attr(feature = "serde", serde(tag = "type"))]
2436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2437#[repr(u32)]
2438#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2439pub enum MavMissionResult {
2440 #[doc = "mission accepted OK"]
2441 MAV_MISSION_ACCEPTED = 0,
2442 #[doc = "Generic error / not accepting mission commands at all right now."]
2443 MAV_MISSION_ERROR = 1,
2444 #[doc = "Coordinate frame is not supported."]
2445 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2446 #[doc = "Command is not supported."]
2447 MAV_MISSION_UNSUPPORTED = 3,
2448 #[doc = "Mission items exceed storage space."]
2449 MAV_MISSION_NO_SPACE = 4,
2450 #[doc = "One of the parameters has an invalid value."]
2451 MAV_MISSION_INVALID = 5,
2452 #[doc = "param1 has an invalid value."]
2453 MAV_MISSION_INVALID_PARAM1 = 6,
2454 #[doc = "param2 has an invalid value."]
2455 MAV_MISSION_INVALID_PARAM2 = 7,
2456 #[doc = "param3 has an invalid value."]
2457 MAV_MISSION_INVALID_PARAM3 = 8,
2458 #[doc = "param4 has an invalid value."]
2459 MAV_MISSION_INVALID_PARAM4 = 9,
2460 #[doc = "x / param5 has an invalid value."]
2461 MAV_MISSION_INVALID_PARAM5_X = 10,
2462 #[doc = "y / param6 has an invalid value."]
2463 MAV_MISSION_INVALID_PARAM6_Y = 11,
2464 #[doc = "z / param7 has an invalid value."]
2465 MAV_MISSION_INVALID_PARAM7 = 12,
2466 #[doc = "Mission item received out of sequence"]
2467 MAV_MISSION_INVALID_SEQUENCE = 13,
2468 #[doc = "Not accepting any mission commands from this communication partner."]
2469 MAV_MISSION_DENIED = 14,
2470 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2471 MAV_MISSION_OPERATION_CANCELLED = 15,
2472}
2473impl MavMissionResult {
2474 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2475}
2476impl Default for MavMissionResult {
2477 fn default() -> Self {
2478 Self::DEFAULT
2479 }
2480}
2481#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2483#[cfg_attr(feature = "serde", serde(tag = "type"))]
2484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2485#[repr(u32)]
2486#[doc = "Type of mission items being requested/sent in mission protocol."]
2487pub enum MavMissionType {
2488 #[doc = "Items are mission commands for main mission."]
2489 MAV_MISSION_TYPE_MISSION = 0,
2490 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2491 MAV_MISSION_TYPE_FENCE = 1,
2492 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2493 MAV_MISSION_TYPE_RALLY = 2,
2494 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2495 MAV_MISSION_TYPE_ALL = 255,
2496}
2497impl MavMissionType {
2498 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2499}
2500impl Default for MavMissionType {
2501 fn default() -> Self {
2502 Self::DEFAULT
2503 }
2504}
2505#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2507#[cfg_attr(feature = "serde", serde(tag = "type"))]
2508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2509#[repr(u32)]
2510#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2511pub enum MavMode {
2512 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2513 MAV_MODE_PREFLIGHT = 0,
2514 #[doc = "System is allowed to be active, under assisted RC control."]
2515 MAV_MODE_STABILIZE_DISARMED = 80,
2516 #[doc = "System is allowed to be active, under assisted RC control."]
2517 MAV_MODE_STABILIZE_ARMED = 208,
2518 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2519 MAV_MODE_MANUAL_DISARMED = 64,
2520 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2521 MAV_MODE_MANUAL_ARMED = 192,
2522 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2523 MAV_MODE_GUIDED_DISARMED = 88,
2524 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2525 MAV_MODE_GUIDED_ARMED = 216,
2526 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2527 MAV_MODE_AUTO_DISARMED = 92,
2528 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2529 MAV_MODE_AUTO_ARMED = 220,
2530 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2531 MAV_MODE_TEST_DISARMED = 66,
2532 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2533 MAV_MODE_TEST_ARMED = 194,
2534}
2535impl MavMode {
2536 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2537}
2538impl Default for MavMode {
2539 fn default() -> Self {
2540 Self::DEFAULT
2541 }
2542}
2543bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2544impl MavModeFlag {
2545 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2546}
2547impl Default for MavModeFlag {
2548 fn default() -> Self {
2549 Self::DEFAULT
2550 }
2551}
2552#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2554#[cfg_attr(feature = "serde", serde(tag = "type"))]
2555#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2556#[repr(u32)]
2557#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2558pub enum MavModeFlagDecodePosition {
2559 #[doc = "First bit: 10000000"]
2560 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2561 #[doc = "Second bit: 01000000"]
2562 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2563 #[doc = "Third bit: 00100000"]
2564 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2565 #[doc = "Fourth bit: 00010000"]
2566 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2567 #[doc = "Fifth bit: 00001000"]
2568 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2569 #[doc = "Sixth bit: 00000100"]
2570 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2571 #[doc = "Seventh bit: 00000010"]
2572 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2573 #[doc = "Eighth bit: 00000001"]
2574 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2575}
2576impl MavModeFlagDecodePosition {
2577 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2578}
2579impl Default for MavModeFlagDecodePosition {
2580 fn default() -> Self {
2581 Self::DEFAULT
2582 }
2583}
2584bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2585impl MavModeProperty {
2586 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2587}
2588impl Default for MavModeProperty {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2595#[cfg_attr(feature = "serde", serde(tag = "type"))]
2596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2597#[repr(u32)]
2598#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2599#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2600pub enum MavMountMode {
2601 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2602 MAV_MOUNT_MODE_RETRACT = 0,
2603 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2604 MAV_MOUNT_MODE_NEUTRAL = 1,
2605 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2606 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2607 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2608 MAV_MOUNT_MODE_RC_TARGETING = 3,
2609 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2610 MAV_MOUNT_MODE_GPS_POINT = 4,
2611 #[doc = "Gimbal tracks system with specified system ID"]
2612 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2613 #[doc = "Gimbal tracks home position"]
2614 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2615}
2616impl MavMountMode {
2617 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2618}
2619impl Default for MavMountMode {
2620 fn default() -> Self {
2621 Self::DEFAULT
2622 }
2623}
2624#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2626#[cfg_attr(feature = "serde", serde(tag = "type"))]
2627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2628#[repr(u32)]
2629pub enum MavOdidArmStatus {
2630 #[doc = "Passing arming checks."]
2631 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2632 #[doc = "Generic arming failure, see error string for details."]
2633 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2634}
2635impl MavOdidArmStatus {
2636 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2637}
2638impl Default for MavOdidArmStatus {
2639 fn default() -> Self {
2640 Self::DEFAULT
2641 }
2642}
2643#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2644#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2645#[cfg_attr(feature = "serde", serde(tag = "type"))]
2646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2647#[repr(u32)]
2648pub enum MavOdidAuthType {
2649 #[doc = "No authentication type is specified."]
2650 MAV_ODID_AUTH_TYPE_NONE = 0,
2651 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2652 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2653 #[doc = "Signature for the Operator ID."]
2654 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2655 #[doc = "Signature for the entire message set."]
2656 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2657 #[doc = "Authentication is provided by Network Remote ID."]
2658 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2659 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2660 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2661}
2662impl MavOdidAuthType {
2663 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2664}
2665impl Default for MavOdidAuthType {
2666 fn default() -> Self {
2667 Self::DEFAULT
2668 }
2669}
2670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2672#[cfg_attr(feature = "serde", serde(tag = "type"))]
2673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2674#[repr(u32)]
2675pub enum MavOdidCategoryEu {
2676 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2677 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2678 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2679 MAV_ODID_CATEGORY_EU_OPEN = 1,
2680 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2681 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2682 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2683 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2684}
2685impl MavOdidCategoryEu {
2686 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2687}
2688impl Default for MavOdidCategoryEu {
2689 fn default() -> Self {
2690 Self::DEFAULT
2691 }
2692}
2693#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2695#[cfg_attr(feature = "serde", serde(tag = "type"))]
2696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2697#[repr(u32)]
2698pub enum MavOdidClassEu {
2699 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2700 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2701 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2702 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2703 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2704 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2705 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2706 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2707 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2708 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2709 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2710 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2711 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2712 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2713 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2714 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2715}
2716impl MavOdidClassEu {
2717 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2718}
2719impl Default for MavOdidClassEu {
2720 fn default() -> Self {
2721 Self::DEFAULT
2722 }
2723}
2724#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2725#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2726#[cfg_attr(feature = "serde", serde(tag = "type"))]
2727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2728#[repr(u32)]
2729pub enum MavOdidClassificationType {
2730 #[doc = "The classification type for the UA is undeclared."]
2731 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2732 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2733 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2734}
2735impl MavOdidClassificationType {
2736 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2737}
2738impl Default for MavOdidClassificationType {
2739 fn default() -> Self {
2740 Self::DEFAULT
2741 }
2742}
2743#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2745#[cfg_attr(feature = "serde", serde(tag = "type"))]
2746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2747#[repr(u32)]
2748pub enum MavOdidDescType {
2749 #[doc = "Optional free-form text description of the purpose of the flight."]
2750 MAV_ODID_DESC_TYPE_TEXT = 0,
2751 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2752 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2753 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2754 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2755}
2756impl MavOdidDescType {
2757 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2758}
2759impl Default for MavOdidDescType {
2760 fn default() -> Self {
2761 Self::DEFAULT
2762 }
2763}
2764#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2766#[cfg_attr(feature = "serde", serde(tag = "type"))]
2767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2768#[repr(u32)]
2769pub enum MavOdidHeightRef {
2770 #[doc = "The height field is relative to the take-off location."]
2771 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2772 #[doc = "The height field is relative to ground."]
2773 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2774}
2775impl MavOdidHeightRef {
2776 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2777}
2778impl Default for MavOdidHeightRef {
2779 fn default() -> Self {
2780 Self::DEFAULT
2781 }
2782}
2783#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2785#[cfg_attr(feature = "serde", serde(tag = "type"))]
2786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2787#[repr(u32)]
2788pub enum MavOdidHorAcc {
2789 #[doc = "The horizontal accuracy is unknown."]
2790 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2791 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2792 MAV_ODID_HOR_ACC_10NM = 1,
2793 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2794 MAV_ODID_HOR_ACC_4NM = 2,
2795 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2796 MAV_ODID_HOR_ACC_2NM = 3,
2797 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2798 MAV_ODID_HOR_ACC_1NM = 4,
2799 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2800 MAV_ODID_HOR_ACC_0_5NM = 5,
2801 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2802 MAV_ODID_HOR_ACC_0_3NM = 6,
2803 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2804 MAV_ODID_HOR_ACC_0_1NM = 7,
2805 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2806 MAV_ODID_HOR_ACC_0_05NM = 8,
2807 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2808 MAV_ODID_HOR_ACC_30_METER = 9,
2809 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2810 MAV_ODID_HOR_ACC_10_METER = 10,
2811 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2812 MAV_ODID_HOR_ACC_3_METER = 11,
2813 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2814 MAV_ODID_HOR_ACC_1_METER = 12,
2815}
2816impl MavOdidHorAcc {
2817 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2818}
2819impl Default for MavOdidHorAcc {
2820 fn default() -> Self {
2821 Self::DEFAULT
2822 }
2823}
2824#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2826#[cfg_attr(feature = "serde", serde(tag = "type"))]
2827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2828#[repr(u32)]
2829pub enum MavOdidIdType {
2830 #[doc = "No type defined."]
2831 MAV_ODID_ID_TYPE_NONE = 0,
2832 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2833 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2834 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2835 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2836 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2837 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2838 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2839 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2840}
2841impl MavOdidIdType {
2842 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2843}
2844impl Default for MavOdidIdType {
2845 fn default() -> Self {
2846 Self::DEFAULT
2847 }
2848}
2849#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2851#[cfg_attr(feature = "serde", serde(tag = "type"))]
2852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2853#[repr(u32)]
2854pub enum MavOdidOperatorIdType {
2855 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2856 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2857}
2858impl MavOdidOperatorIdType {
2859 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2860}
2861impl Default for MavOdidOperatorIdType {
2862 fn default() -> Self {
2863 Self::DEFAULT
2864 }
2865}
2866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2868#[cfg_attr(feature = "serde", serde(tag = "type"))]
2869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2870#[repr(u32)]
2871pub enum MavOdidOperatorLocationType {
2872 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2873 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2874 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2875 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2876 #[doc = "The location/altitude of the operator are fixed values."]
2877 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2878}
2879impl MavOdidOperatorLocationType {
2880 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2881}
2882impl Default for MavOdidOperatorLocationType {
2883 fn default() -> Self {
2884 Self::DEFAULT
2885 }
2886}
2887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2889#[cfg_attr(feature = "serde", serde(tag = "type"))]
2890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2891#[repr(u32)]
2892pub enum MavOdidSpeedAcc {
2893 #[doc = "The speed accuracy is unknown."]
2894 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2895 #[doc = "The speed accuracy is smaller than 10 meters per second."]
2896 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
2897 #[doc = "The speed accuracy is smaller than 3 meters per second."]
2898 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
2899 #[doc = "The speed accuracy is smaller than 1 meters per second."]
2900 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
2901 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
2902 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
2903}
2904impl MavOdidSpeedAcc {
2905 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
2906}
2907impl Default for MavOdidSpeedAcc {
2908 fn default() -> Self {
2909 Self::DEFAULT
2910 }
2911}
2912#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2914#[cfg_attr(feature = "serde", serde(tag = "type"))]
2915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2916#[repr(u32)]
2917pub enum MavOdidStatus {
2918 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
2919 MAV_ODID_STATUS_UNDECLARED = 0,
2920 #[doc = "The UA is on the ground."]
2921 MAV_ODID_STATUS_GROUND = 1,
2922 #[doc = "The UA is in the air."]
2923 MAV_ODID_STATUS_AIRBORNE = 2,
2924 #[doc = "The UA is having an emergency."]
2925 MAV_ODID_STATUS_EMERGENCY = 3,
2926 #[doc = "The remote ID system is failing or unreliable in some way."]
2927 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
2928}
2929impl MavOdidStatus {
2930 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
2931}
2932impl Default for MavOdidStatus {
2933 fn default() -> Self {
2934 Self::DEFAULT
2935 }
2936}
2937#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2939#[cfg_attr(feature = "serde", serde(tag = "type"))]
2940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2941#[repr(u32)]
2942pub enum MavOdidTimeAcc {
2943 #[doc = "The timestamp accuracy is unknown."]
2944 MAV_ODID_TIME_ACC_UNKNOWN = 0,
2945 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
2946 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
2947 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
2948 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
2949 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
2950 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
2951 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
2952 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
2953 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
2954 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
2955 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
2956 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
2957 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
2958 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
2959 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
2960 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
2961 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
2962 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
2963 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
2964 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
2965 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
2966 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
2967 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
2968 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
2969 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
2970 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
2971 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
2972 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
2973 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
2974 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
2975}
2976impl MavOdidTimeAcc {
2977 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
2978}
2979impl Default for MavOdidTimeAcc {
2980 fn default() -> Self {
2981 Self::DEFAULT
2982 }
2983}
2984#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2986#[cfg_attr(feature = "serde", serde(tag = "type"))]
2987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2988#[repr(u32)]
2989pub enum MavOdidUaType {
2990 #[doc = "No UA (Unmanned Aircraft) type defined."]
2991 MAV_ODID_UA_TYPE_NONE = 0,
2992 #[doc = "Aeroplane/Airplane. Fixed wing."]
2993 MAV_ODID_UA_TYPE_AEROPLANE = 1,
2994 #[doc = "Helicopter or multirotor."]
2995 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
2996 #[doc = "Gyroplane."]
2997 MAV_ODID_UA_TYPE_GYROPLANE = 3,
2998 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
2999 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3000 #[doc = "Ornithopter."]
3001 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3002 #[doc = "Glider."]
3003 MAV_ODID_UA_TYPE_GLIDER = 6,
3004 #[doc = "Kite."]
3005 MAV_ODID_UA_TYPE_KITE = 7,
3006 #[doc = "Free Balloon."]
3007 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3008 #[doc = "Captive Balloon."]
3009 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3010 #[doc = "Airship. E.g. a blimp."]
3011 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3012 #[doc = "Free Fall/Parachute (unpowered)."]
3013 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3014 #[doc = "Rocket."]
3015 MAV_ODID_UA_TYPE_ROCKET = 12,
3016 #[doc = "Tethered powered aircraft."]
3017 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3018 #[doc = "Ground Obstacle."]
3019 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3020 #[doc = "Other type of aircraft not listed earlier."]
3021 MAV_ODID_UA_TYPE_OTHER = 15,
3022}
3023impl MavOdidUaType {
3024 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3025}
3026impl Default for MavOdidUaType {
3027 fn default() -> Self {
3028 Self::DEFAULT
3029 }
3030}
3031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3033#[cfg_attr(feature = "serde", serde(tag = "type"))]
3034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3035#[repr(u32)]
3036pub enum MavOdidVerAcc {
3037 #[doc = "The vertical accuracy is unknown."]
3038 MAV_ODID_VER_ACC_UNKNOWN = 0,
3039 #[doc = "The vertical accuracy is smaller than 150 meter."]
3040 MAV_ODID_VER_ACC_150_METER = 1,
3041 #[doc = "The vertical accuracy is smaller than 45 meter."]
3042 MAV_ODID_VER_ACC_45_METER = 2,
3043 #[doc = "The vertical accuracy is smaller than 25 meter."]
3044 MAV_ODID_VER_ACC_25_METER = 3,
3045 #[doc = "The vertical accuracy is smaller than 10 meter."]
3046 MAV_ODID_VER_ACC_10_METER = 4,
3047 #[doc = "The vertical accuracy is smaller than 3 meter."]
3048 MAV_ODID_VER_ACC_3_METER = 5,
3049 #[doc = "The vertical accuracy is smaller than 1 meter."]
3050 MAV_ODID_VER_ACC_1_METER = 6,
3051}
3052impl MavOdidVerAcc {
3053 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3054}
3055impl Default for MavOdidVerAcc {
3056 fn default() -> Self {
3057 Self::DEFAULT
3058 }
3059}
3060#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3062#[cfg_attr(feature = "serde", serde(tag = "type"))]
3063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3064#[repr(u32)]
3065#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3066pub enum MavParamExtType {
3067 #[doc = "8-bit unsigned integer"]
3068 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3069 #[doc = "8-bit signed integer"]
3070 MAV_PARAM_EXT_TYPE_INT8 = 2,
3071 #[doc = "16-bit unsigned integer"]
3072 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3073 #[doc = "16-bit signed integer"]
3074 MAV_PARAM_EXT_TYPE_INT16 = 4,
3075 #[doc = "32-bit unsigned integer"]
3076 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3077 #[doc = "32-bit signed integer"]
3078 MAV_PARAM_EXT_TYPE_INT32 = 6,
3079 #[doc = "64-bit unsigned integer"]
3080 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3081 #[doc = "64-bit signed integer"]
3082 MAV_PARAM_EXT_TYPE_INT64 = 8,
3083 #[doc = "32-bit floating-point"]
3084 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3085 #[doc = "64-bit floating-point"]
3086 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3087 #[doc = "Custom Type"]
3088 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3089}
3090impl MavParamExtType {
3091 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3092}
3093impl Default for MavParamExtType {
3094 fn default() -> Self {
3095 Self::DEFAULT
3096 }
3097}
3098#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3100#[cfg_attr(feature = "serde", serde(tag = "type"))]
3101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3102#[repr(u32)]
3103#[doc = "Specifies the datatype of a MAVLink parameter."]
3104pub enum MavParamType {
3105 #[doc = "8-bit unsigned integer"]
3106 MAV_PARAM_TYPE_UINT8 = 1,
3107 #[doc = "8-bit signed integer"]
3108 MAV_PARAM_TYPE_INT8 = 2,
3109 #[doc = "16-bit unsigned integer"]
3110 MAV_PARAM_TYPE_UINT16 = 3,
3111 #[doc = "16-bit signed integer"]
3112 MAV_PARAM_TYPE_INT16 = 4,
3113 #[doc = "32-bit unsigned integer"]
3114 MAV_PARAM_TYPE_UINT32 = 5,
3115 #[doc = "32-bit signed integer"]
3116 MAV_PARAM_TYPE_INT32 = 6,
3117 #[doc = "64-bit unsigned integer"]
3118 MAV_PARAM_TYPE_UINT64 = 7,
3119 #[doc = "64-bit signed integer"]
3120 MAV_PARAM_TYPE_INT64 = 8,
3121 #[doc = "32-bit floating-point"]
3122 MAV_PARAM_TYPE_REAL32 = 9,
3123 #[doc = "64-bit floating-point"]
3124 MAV_PARAM_TYPE_REAL64 = 10,
3125}
3126impl MavParamType {
3127 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3128}
3129impl Default for MavParamType {
3130 fn default() -> Self {
3131 Self::DEFAULT
3132 }
3133}
3134bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3135impl MavPowerStatus {
3136 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3137}
3138impl Default for MavPowerStatus {
3139 fn default() -> Self {
3140 Self::DEFAULT
3141 }
3142}
3143bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3144impl MavProtocolCapability {
3145 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3146}
3147impl Default for MavProtocolCapability {
3148 fn default() -> Self {
3149 Self::DEFAULT
3150 }
3151}
3152#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3154#[cfg_attr(feature = "serde", serde(tag = "type"))]
3155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3156#[repr(u32)]
3157#[doc = "Result from a MAVLink command (MAV_CMD)"]
3158pub enum MavResult {
3159 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3160 MAV_RESULT_ACCEPTED = 0,
3161 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3162 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3163 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3164 MAV_RESULT_DENIED = 2,
3165 #[doc = "Command is not supported (unknown)."]
3166 MAV_RESULT_UNSUPPORTED = 3,
3167 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3168 MAV_RESULT_FAILED = 4,
3169 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3170 MAV_RESULT_IN_PROGRESS = 5,
3171 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3172 MAV_RESULT_CANCELLED = 6,
3173 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3174 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3175 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3176 MAV_RESULT_COMMAND_INT_ONLY = 8,
3177 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3178 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3179}
3180impl MavResult {
3181 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3182}
3183impl Default for MavResult {
3184 fn default() -> Self {
3185 Self::DEFAULT
3186 }
3187}
3188#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3190#[cfg_attr(feature = "serde", serde(tag = "type"))]
3191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3192#[repr(u32)]
3193#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3194#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3195pub enum MavRoi {
3196 #[doc = "No region of interest."]
3197 MAV_ROI_NONE = 0,
3198 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3199 MAV_ROI_WPNEXT = 1,
3200 #[doc = "Point toward given waypoint."]
3201 MAV_ROI_WPINDEX = 2,
3202 #[doc = "Point toward fixed location."]
3203 MAV_ROI_LOCATION = 3,
3204 #[doc = "Point toward of given id."]
3205 MAV_ROI_TARGET = 4,
3206}
3207impl MavRoi {
3208 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3209}
3210impl Default for MavRoi {
3211 fn default() -> Self {
3212 Self::DEFAULT
3213 }
3214}
3215#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3217#[cfg_attr(feature = "serde", serde(tag = "type"))]
3218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3219#[repr(u32)]
3220#[doc = "Enumeration of sensor orientation, according to its rotations"]
3221pub enum MavSensorOrientation {
3222 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3223 MAV_SENSOR_ROTATION_NONE = 0,
3224 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3225 MAV_SENSOR_ROTATION_YAW_45 = 1,
3226 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3227 MAV_SENSOR_ROTATION_YAW_90 = 2,
3228 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3229 MAV_SENSOR_ROTATION_YAW_135 = 3,
3230 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3231 MAV_SENSOR_ROTATION_YAW_180 = 4,
3232 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3233 MAV_SENSOR_ROTATION_YAW_225 = 5,
3234 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3235 MAV_SENSOR_ROTATION_YAW_270 = 6,
3236 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3237 MAV_SENSOR_ROTATION_YAW_315 = 7,
3238 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3239 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3240 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3241 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3242 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3243 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3244 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3245 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3246 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3247 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3248 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3249 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3250 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3251 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3252 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3253 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3254 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3255 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3256 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3257 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3258 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3259 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3260 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3261 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3262 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3263 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3264 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3265 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3266 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3267 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3268 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3269 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3270 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3271 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3272 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3273 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3274 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3275 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3276 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3277 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3278 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3279 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3280 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3281 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3282 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3283 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3284 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3285 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3286 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3287 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3288 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3289 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3290 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3291 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3292 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3293 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3294 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3295 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3296 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3297 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3298 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3299 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3300 #[doc = "Pitch: 315"]
3301 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3302 #[doc = "Roll: 90, Pitch: 315"]
3303 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3304 #[doc = "Custom orientation"]
3305 MAV_SENSOR_ROTATION_CUSTOM = 100,
3306}
3307impl MavSensorOrientation {
3308 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3309}
3310impl Default for MavSensorOrientation {
3311 fn default() -> Self {
3312 Self::DEFAULT
3313 }
3314}
3315#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3317#[cfg_attr(feature = "serde", serde(tag = "type"))]
3318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3319#[repr(u32)]
3320#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3321pub enum MavSeverity {
3322 #[doc = "System is unusable. This is a \"panic\" condition."]
3323 MAV_SEVERITY_EMERGENCY = 0,
3324 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3325 MAV_SEVERITY_ALERT = 1,
3326 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3327 MAV_SEVERITY_CRITICAL = 2,
3328 #[doc = "Indicates an error in secondary/redundant systems."]
3329 MAV_SEVERITY_ERROR = 3,
3330 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3331 MAV_SEVERITY_WARNING = 4,
3332 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3333 MAV_SEVERITY_NOTICE = 5,
3334 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3335 MAV_SEVERITY_INFO = 6,
3336 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3337 MAV_SEVERITY_DEBUG = 7,
3338}
3339impl MavSeverity {
3340 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3341}
3342impl Default for MavSeverity {
3343 fn default() -> Self {
3344 Self::DEFAULT
3345 }
3346}
3347#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3348#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3349#[cfg_attr(feature = "serde", serde(tag = "type"))]
3350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3351#[repr(u32)]
3352#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3353pub enum MavStandardMode {
3354 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3355 MAV_STANDARD_MODE_NON_STANDARD = 0,
3356 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3357 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3358 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3359 MAV_STANDARD_MODE_ORBIT = 2,
3360 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3361 MAV_STANDARD_MODE_CRUISE = 3,
3362 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3363 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3364 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3365 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3366 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3367 MAV_STANDARD_MODE_MISSION = 6,
3368 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3369 MAV_STANDARD_MODE_LAND = 7,
3370 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3371 MAV_STANDARD_MODE_TAKEOFF = 8,
3372}
3373impl MavStandardMode {
3374 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3375}
3376impl Default for MavStandardMode {
3377 fn default() -> Self {
3378 Self::DEFAULT
3379 }
3380}
3381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3383#[cfg_attr(feature = "serde", serde(tag = "type"))]
3384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3385#[repr(u32)]
3386pub enum MavState {
3387 #[doc = "Uninitialized system, state is unknown."]
3388 MAV_STATE_UNINIT = 0,
3389 #[doc = "System is booting up."]
3390 MAV_STATE_BOOT = 1,
3391 #[doc = "System is calibrating and not flight-ready."]
3392 MAV_STATE_CALIBRATING = 2,
3393 #[doc = "System is grounded and on standby. It can be launched any time."]
3394 MAV_STATE_STANDBY = 3,
3395 #[doc = "System is active and might be already airborne. Motors are engaged."]
3396 MAV_STATE_ACTIVE = 4,
3397 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3398 MAV_STATE_CRITICAL = 5,
3399 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3400 MAV_STATE_EMERGENCY = 6,
3401 #[doc = "System just initialized its power-down sequence, will shut down now."]
3402 MAV_STATE_POWEROFF = 7,
3403 #[doc = "System is terminating itself (failsafe or commanded)."]
3404 MAV_STATE_FLIGHT_TERMINATION = 8,
3405}
3406impl MavState {
3407 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3408}
3409impl Default for MavState {
3410 fn default() -> Self {
3411 Self::DEFAULT
3412 }
3413}
3414bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3415impl MavSysStatusSensor {
3416 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3417}
3418impl Default for MavSysStatusSensor {
3419 fn default() -> Self {
3420 Self::DEFAULT
3421 }
3422}
3423bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3424impl MavSysStatusSensorExtended {
3425 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3426}
3427impl Default for MavSysStatusSensorExtended {
3428 fn default() -> Self {
3429 Self::DEFAULT
3430 }
3431}
3432#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3434#[cfg_attr(feature = "serde", serde(tag = "type"))]
3435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3436#[repr(u32)]
3437pub enum MavTunnelPayloadType {
3438 #[doc = "Encoding of payload unknown."]
3439 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3440 #[doc = "Registered for STorM32 gimbal controller."]
3441 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3442 #[doc = "Registered for STorM32 gimbal controller."]
3443 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3444 #[doc = "Registered for STorM32 gimbal controller."]
3445 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3446 #[doc = "Registered for STorM32 gimbal controller."]
3447 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3448 #[doc = "Registered for STorM32 gimbal controller."]
3449 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3450 #[doc = "Registered for STorM32 gimbal controller."]
3451 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3452 #[doc = "Registered for STorM32 gimbal controller."]
3453 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3454 #[doc = "Registered for STorM32 gimbal controller."]
3455 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3456 #[doc = "Registered for STorM32 gimbal controller."]
3457 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3458 #[doc = "Registered for STorM32 gimbal controller."]
3459 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3460 #[doc = "Registered for ModalAI remote OSD protocol."]
3461 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3462 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3463 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3464 #[doc = "Registered for ModalAI vendor use."]
3465 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3466}
3467impl MavTunnelPayloadType {
3468 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3469}
3470impl Default for MavTunnelPayloadType {
3471 fn default() -> Self {
3472 Self::DEFAULT
3473 }
3474}
3475#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3476#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3477#[cfg_attr(feature = "serde", serde(tag = "type"))]
3478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3479#[repr(u32)]
3480#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3481pub enum MavType {
3482 #[doc = "Generic micro air vehicle"]
3483 MAV_TYPE_GENERIC = 0,
3484 #[doc = "Fixed wing aircraft."]
3485 MAV_TYPE_FIXED_WING = 1,
3486 #[doc = "Quadrotor"]
3487 MAV_TYPE_QUADROTOR = 2,
3488 #[doc = "Coaxial helicopter"]
3489 MAV_TYPE_COAXIAL = 3,
3490 #[doc = "Normal helicopter with tail rotor."]
3491 MAV_TYPE_HELICOPTER = 4,
3492 #[doc = "Ground installation"]
3493 MAV_TYPE_ANTENNA_TRACKER = 5,
3494 #[doc = "Operator control unit / ground control station"]
3495 MAV_TYPE_GCS = 6,
3496 #[doc = "Airship, controlled"]
3497 MAV_TYPE_AIRSHIP = 7,
3498 #[doc = "Free balloon, uncontrolled"]
3499 MAV_TYPE_FREE_BALLOON = 8,
3500 #[doc = "Rocket"]
3501 MAV_TYPE_ROCKET = 9,
3502 #[doc = "Ground rover"]
3503 MAV_TYPE_GROUND_ROVER = 10,
3504 #[doc = "Surface vessel, boat, ship"]
3505 MAV_TYPE_SURFACE_BOAT = 11,
3506 #[doc = "Submarine"]
3507 MAV_TYPE_SUBMARINE = 12,
3508 #[doc = "Hexarotor"]
3509 MAV_TYPE_HEXAROTOR = 13,
3510 #[doc = "Octorotor"]
3511 MAV_TYPE_OCTOROTOR = 14,
3512 #[doc = "Tricopter"]
3513 MAV_TYPE_TRICOPTER = 15,
3514 #[doc = "Flapping wing"]
3515 MAV_TYPE_FLAPPING_WING = 16,
3516 #[doc = "Kite"]
3517 MAV_TYPE_KITE = 17,
3518 #[doc = "Onboard companion controller"]
3519 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3520 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3521 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3522 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3523 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3524 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3525 MAV_TYPE_VTOL_TILTROTOR = 21,
3526 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3527 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3528 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3529 MAV_TYPE_VTOL_TAILSITTER = 23,
3530 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3531 MAV_TYPE_VTOL_TILTWING = 24,
3532 #[doc = "VTOL reserved 5"]
3533 MAV_TYPE_VTOL_RESERVED5 = 25,
3534 #[doc = "Gimbal"]
3535 MAV_TYPE_GIMBAL = 26,
3536 #[doc = "ADSB system"]
3537 MAV_TYPE_ADSB = 27,
3538 #[doc = "Steerable, nonrigid airfoil"]
3539 MAV_TYPE_PARAFOIL = 28,
3540 #[doc = "Dodecarotor"]
3541 MAV_TYPE_DODECAROTOR = 29,
3542 #[doc = "Camera"]
3543 MAV_TYPE_CAMERA = 30,
3544 #[doc = "Charging station"]
3545 MAV_TYPE_CHARGING_STATION = 31,
3546 #[doc = "FLARM collision avoidance system"]
3547 MAV_TYPE_FLARM = 32,
3548 #[doc = "Servo"]
3549 MAV_TYPE_SERVO = 33,
3550 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3551 MAV_TYPE_ODID = 34,
3552 #[doc = "Decarotor"]
3553 MAV_TYPE_DECAROTOR = 35,
3554 #[doc = "Battery"]
3555 MAV_TYPE_BATTERY = 36,
3556 #[doc = "Parachute"]
3557 MAV_TYPE_PARACHUTE = 37,
3558 #[doc = "Log"]
3559 MAV_TYPE_LOG = 38,
3560 #[doc = "OSD"]
3561 MAV_TYPE_OSD = 39,
3562 #[doc = "IMU"]
3563 MAV_TYPE_IMU = 40,
3564 #[doc = "GPS"]
3565 MAV_TYPE_GPS = 41,
3566 #[doc = "Winch"]
3567 MAV_TYPE_WINCH = 42,
3568 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3569 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3570 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3571 MAV_TYPE_ILLUMINATOR = 44,
3572 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3573 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3574}
3575impl MavType {
3576 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3577}
3578impl Default for MavType {
3579 fn default() -> Self {
3580 Self::DEFAULT
3581 }
3582}
3583#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3585#[cfg_attr(feature = "serde", serde(tag = "type"))]
3586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3587#[repr(u32)]
3588#[doc = "Enumeration of VTOL states"]
3589pub enum MavVtolState {
3590 #[doc = "MAV is not configured as VTOL"]
3591 MAV_VTOL_STATE_UNDEFINED = 0,
3592 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3593 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3594 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3595 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3596 #[doc = "VTOL is in multicopter state"]
3597 MAV_VTOL_STATE_MC = 3,
3598 #[doc = "VTOL is in fixed-wing state"]
3599 MAV_VTOL_STATE_FW = 4,
3600}
3601impl MavVtolState {
3602 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3603}
3604impl Default for MavVtolState {
3605 fn default() -> Self {
3606 Self::DEFAULT
3607 }
3608}
3609bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3610impl MavWinchStatusFlag {
3611 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3612}
3613impl Default for MavWinchStatusFlag {
3614 fn default() -> Self {
3615 Self::DEFAULT
3616 }
3617}
3618#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3620#[cfg_attr(feature = "serde", serde(tag = "type"))]
3621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3622#[repr(u32)]
3623pub enum MavlinkDataStreamType {
3624 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3625 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3626 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3627 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3628 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3629 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3630}
3631impl MavlinkDataStreamType {
3632 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3633}
3634impl Default for MavlinkDataStreamType {
3635 fn default() -> Self {
3636 Self::DEFAULT
3637 }
3638}
3639#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3641#[cfg_attr(feature = "serde", serde(tag = "type"))]
3642#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3643#[repr(u32)]
3644#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3645pub enum MissionState {
3646 #[doc = "The mission status reporting is not supported."]
3647 MISSION_STATE_UNKNOWN = 0,
3648 #[doc = "No mission on the vehicle."]
3649 MISSION_STATE_NO_MISSION = 1,
3650 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3651 MISSION_STATE_NOT_STARTED = 2,
3652 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3653 MISSION_STATE_ACTIVE = 3,
3654 #[doc = "Mission is paused when in auto mode."]
3655 MISSION_STATE_PAUSED = 4,
3656 #[doc = "Mission has executed all mission items."]
3657 MISSION_STATE_COMPLETE = 5,
3658}
3659impl MissionState {
3660 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3661}
3662impl Default for MissionState {
3663 fn default() -> Self {
3664 Self::DEFAULT
3665 }
3666}
3667#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3668#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3669#[cfg_attr(feature = "serde", serde(tag = "type"))]
3670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3671#[repr(u32)]
3672#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3673pub enum MotorTestOrder {
3674 #[doc = "Default autopilot motor test method."]
3675 MOTOR_TEST_ORDER_DEFAULT = 0,
3676 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3677 MOTOR_TEST_ORDER_SEQUENCE = 1,
3678 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3679 MOTOR_TEST_ORDER_BOARD = 2,
3680}
3681impl MotorTestOrder {
3682 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3683}
3684impl Default for MotorTestOrder {
3685 fn default() -> Self {
3686 Self::DEFAULT
3687 }
3688}
3689#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3690#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3691#[cfg_attr(feature = "serde", serde(tag = "type"))]
3692#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3693#[repr(u32)]
3694#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3695pub enum MotorTestThrottleType {
3696 #[doc = "Throttle as a percentage (0 ~ 100)"]
3697 MOTOR_TEST_THROTTLE_PERCENT = 0,
3698 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3699 MOTOR_TEST_THROTTLE_PWM = 1,
3700 #[doc = "Throttle pass-through from pilot's transmitter."]
3701 MOTOR_TEST_THROTTLE_PILOT = 2,
3702 #[doc = "Per-motor compass calibration test."]
3703 MOTOR_TEST_COMPASS_CAL = 3,
3704}
3705impl MotorTestThrottleType {
3706 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3707}
3708impl Default for MotorTestThrottleType {
3709 fn default() -> Self {
3710 Self::DEFAULT
3711 }
3712}
3713#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3715#[cfg_attr(feature = "serde", serde(tag = "type"))]
3716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3717#[repr(u32)]
3718pub enum NavVtolLandOptions {
3719 #[doc = "Default autopilot landing behaviour."]
3720 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3721 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3722 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3723 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3724 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3725}
3726impl NavVtolLandOptions {
3727 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3728}
3729impl Default for NavVtolLandOptions {
3730 fn default() -> Self {
3731 Self::DEFAULT
3732 }
3733}
3734#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3736#[cfg_attr(feature = "serde", serde(tag = "type"))]
3737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3738#[repr(u32)]
3739#[doc = "Yaw behaviour during orbit flight."]
3740pub enum OrbitYawBehaviour {
3741 #[doc = "Vehicle front points to the center (default)."]
3742 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3743 #[doc = "Vehicle front holds heading when message received."]
3744 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3745 #[doc = "Yaw uncontrolled."]
3746 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3747 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3748 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3749 #[doc = "Yaw controlled by RC input."]
3750 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3751 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3752 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3753}
3754impl OrbitYawBehaviour {
3755 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3756}
3757impl Default for OrbitYawBehaviour {
3758 fn default() -> Self {
3759 Self::DEFAULT
3760 }
3761}
3762#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3763#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3764#[cfg_attr(feature = "serde", serde(tag = "type"))]
3765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3766#[repr(u32)]
3767#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3768pub enum ParachuteAction {
3769 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3770 PARACHUTE_DISABLE = 0,
3771 #[doc = "Enable auto-release of parachute."]
3772 PARACHUTE_ENABLE = 1,
3773 #[doc = "Release parachute and kill motors."]
3774 PARACHUTE_RELEASE = 2,
3775}
3776impl ParachuteAction {
3777 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3778}
3779impl Default for ParachuteAction {
3780 fn default() -> Self {
3781 Self::DEFAULT
3782 }
3783}
3784#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3786#[cfg_attr(feature = "serde", serde(tag = "type"))]
3787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3788#[repr(u32)]
3789#[doc = "Result from PARAM_EXT_SET message."]
3790pub enum ParamAck {
3791 #[doc = "Parameter value ACCEPTED and SET"]
3792 PARAM_ACK_ACCEPTED = 0,
3793 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3794 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3795 #[doc = "Parameter failed to set"]
3796 PARAM_ACK_FAILED = 2,
3797 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3798 PARAM_ACK_IN_PROGRESS = 3,
3799}
3800impl ParamAck {
3801 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3802}
3803impl Default for ParamAck {
3804 fn default() -> Self {
3805 Self::DEFAULT
3806 }
3807}
3808bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3809impl PositionTargetTypemask {
3810 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3811}
3812impl Default for PositionTargetTypemask {
3813 fn default() -> Self {
3814 Self::DEFAULT
3815 }
3816}
3817#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3819#[cfg_attr(feature = "serde", serde(tag = "type"))]
3820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3821#[repr(u32)]
3822#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3823pub enum PrecisionLandMode {
3824 #[doc = "Normal (non-precision) landing."]
3825 PRECISION_LAND_MODE_DISABLED = 0,
3826 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3827 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3828 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3829 PRECISION_LAND_MODE_REQUIRED = 2,
3830}
3831impl PrecisionLandMode {
3832 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3833}
3834impl Default for PrecisionLandMode {
3835 fn default() -> Self {
3836 Self::DEFAULT
3837 }
3838}
3839#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3841#[cfg_attr(feature = "serde", serde(tag = "type"))]
3842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3843#[repr(u32)]
3844#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3845pub enum PreflightStorageMissionAction {
3846 #[doc = "Read current mission data from persistent storage"]
3847 MISSION_READ_PERSISTENT = 0,
3848 #[doc = "Write current mission data to persistent storage"]
3849 MISSION_WRITE_PERSISTENT = 1,
3850 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3851 MISSION_RESET_DEFAULT = 2,
3852}
3853impl PreflightStorageMissionAction {
3854 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3855}
3856impl Default for PreflightStorageMissionAction {
3857 fn default() -> Self {
3858 Self::DEFAULT
3859 }
3860}
3861#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3863#[cfg_attr(feature = "serde", serde(tag = "type"))]
3864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3865#[repr(u32)]
3866#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3867pub enum PreflightStorageParameterAction {
3868 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3869 PARAM_READ_PERSISTENT = 0,
3870 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3871 PARAM_WRITE_PERSISTENT = 1,
3872 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3873 PARAM_RESET_CONFIG_DEFAULT = 2,
3874 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3875 PARAM_RESET_SENSOR_DEFAULT = 3,
3876 #[doc = "Reset all parameters, including operation counters, to default values"]
3877 PARAM_RESET_ALL_DEFAULT = 4,
3878}
3879impl PreflightStorageParameterAction {
3880 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3881}
3882impl Default for PreflightStorageParameterAction {
3883 fn default() -> Self {
3884 Self::DEFAULT
3885 }
3886}
3887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3889#[cfg_attr(feature = "serde", serde(tag = "type"))]
3890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3891#[repr(u32)]
3892#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3893pub enum RcSubType {
3894 #[doc = "Spektrum DSM2"]
3895 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
3896 #[doc = "Spektrum DSMX"]
3897 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
3898 #[doc = "Spektrum DSMX8"]
3899 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
3900}
3901impl RcSubType {
3902 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
3903}
3904impl Default for RcSubType {
3905 fn default() -> Self {
3906 Self::DEFAULT
3907 }
3908}
3909#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3911#[cfg_attr(feature = "serde", serde(tag = "type"))]
3912#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3913#[repr(u32)]
3914#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
3915pub enum RcType {
3916 #[doc = "Spektrum"]
3917 RC_TYPE_SPEKTRUM = 0,
3918 #[doc = "CRSF"]
3919 RC_TYPE_CRSF = 1,
3920}
3921impl RcType {
3922 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
3923}
3924impl Default for RcType {
3925 fn default() -> Self {
3926 Self::DEFAULT
3927 }
3928}
3929#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3931#[cfg_attr(feature = "serde", serde(tag = "type"))]
3932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3933#[repr(u32)]
3934#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
3935pub enum RebootShutdownConditions {
3936 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
3937 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
3938 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
3939 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
3940}
3941impl RebootShutdownConditions {
3942 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
3943}
3944impl Default for RebootShutdownConditions {
3945 fn default() -> Self {
3946 Self::DEFAULT
3947 }
3948}
3949#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3951#[cfg_attr(feature = "serde", serde(tag = "type"))]
3952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3953#[repr(u32)]
3954#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
3955pub enum RtkBaselineCoordinateSystem {
3956 #[doc = "Earth-centered, Earth-fixed"]
3957 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
3958 #[doc = "RTK basestation centered, north, east, down"]
3959 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
3960}
3961impl RtkBaselineCoordinateSystem {
3962 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
3963}
3964impl Default for RtkBaselineCoordinateSystem {
3965 fn default() -> Self {
3966 Self::DEFAULT
3967 }
3968}
3969#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3971#[cfg_attr(feature = "serde", serde(tag = "type"))]
3972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3973#[repr(u32)]
3974#[doc = "Possible safety switch states."]
3975pub enum SafetySwitchState {
3976 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
3977 SAFETY_SWITCH_STATE_SAFE = 0,
3978 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
3979 SAFETY_SWITCH_STATE_DANGEROUS = 1,
3980}
3981impl SafetySwitchState {
3982 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
3983}
3984impl Default for SafetySwitchState {
3985 fn default() -> Self {
3986 Self::DEFAULT
3987 }
3988}
3989#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3991#[cfg_attr(feature = "serde", serde(tag = "type"))]
3992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3993#[repr(u32)]
3994#[doc = "SERIAL_CONTROL device types"]
3995pub enum SerialControlDev {
3996 #[doc = "First telemetry port"]
3997 SERIAL_CONTROL_DEV_TELEM1 = 0,
3998 #[doc = "Second telemetry port"]
3999 SERIAL_CONTROL_DEV_TELEM2 = 1,
4000 #[doc = "First GPS port"]
4001 SERIAL_CONTROL_DEV_GPS1 = 2,
4002 #[doc = "Second GPS port"]
4003 SERIAL_CONTROL_DEV_GPS2 = 3,
4004 #[doc = "system shell"]
4005 SERIAL_CONTROL_DEV_SHELL = 10,
4006 #[doc = "SERIAL0"]
4007 SERIAL_CONTROL_SERIAL0 = 100,
4008 #[doc = "SERIAL1"]
4009 SERIAL_CONTROL_SERIAL1 = 101,
4010 #[doc = "SERIAL2"]
4011 SERIAL_CONTROL_SERIAL2 = 102,
4012 #[doc = "SERIAL3"]
4013 SERIAL_CONTROL_SERIAL3 = 103,
4014 #[doc = "SERIAL4"]
4015 SERIAL_CONTROL_SERIAL4 = 104,
4016 #[doc = "SERIAL5"]
4017 SERIAL_CONTROL_SERIAL5 = 105,
4018 #[doc = "SERIAL6"]
4019 SERIAL_CONTROL_SERIAL6 = 106,
4020 #[doc = "SERIAL7"]
4021 SERIAL_CONTROL_SERIAL7 = 107,
4022 #[doc = "SERIAL8"]
4023 SERIAL_CONTROL_SERIAL8 = 108,
4024 #[doc = "SERIAL9"]
4025 SERIAL_CONTROL_SERIAL9 = 109,
4026}
4027impl SerialControlDev {
4028 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4029}
4030impl Default for SerialControlDev {
4031 fn default() -> Self {
4032 Self::DEFAULT
4033 }
4034}
4035bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4036impl SerialControlFlag {
4037 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4038}
4039impl Default for SerialControlFlag {
4040 fn default() -> Self {
4041 Self::DEFAULT
4042 }
4043}
4044#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4046#[cfg_attr(feature = "serde", serde(tag = "type"))]
4047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4048#[repr(u32)]
4049#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4050pub enum SetFocusType {
4051 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4052 FOCUS_TYPE_STEP = 0,
4053 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4054 FOCUS_TYPE_CONTINUOUS = 1,
4055 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4056 FOCUS_TYPE_RANGE = 2,
4057 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4058 FOCUS_TYPE_METERS = 3,
4059 #[doc = "Focus automatically."]
4060 FOCUS_TYPE_AUTO = 4,
4061 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4062 FOCUS_TYPE_AUTO_SINGLE = 5,
4063 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4064 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4065}
4066impl SetFocusType {
4067 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4068}
4069impl Default for SetFocusType {
4070 fn default() -> Self {
4071 Self::DEFAULT
4072 }
4073}
4074#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4075#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4076#[cfg_attr(feature = "serde", serde(tag = "type"))]
4077#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4078#[repr(u32)]
4079#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4080pub enum SpeedType {
4081 #[doc = "Airspeed"]
4082 SPEED_TYPE_AIRSPEED = 0,
4083 #[doc = "Groundspeed"]
4084 SPEED_TYPE_GROUNDSPEED = 1,
4085 #[doc = "Climb speed"]
4086 SPEED_TYPE_CLIMB_SPEED = 2,
4087 #[doc = "Descent speed"]
4088 SPEED_TYPE_DESCENT_SPEED = 3,
4089}
4090impl SpeedType {
4091 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4092}
4093impl Default for SpeedType {
4094 fn default() -> Self {
4095 Self::DEFAULT
4096 }
4097}
4098#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4100#[cfg_attr(feature = "serde", serde(tag = "type"))]
4101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4102#[repr(u32)]
4103#[doc = "Flags to indicate the status of camera storage."]
4104pub enum StorageStatus {
4105 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4106 STORAGE_STATUS_EMPTY = 0,
4107 #[doc = "Storage present but unformatted."]
4108 STORAGE_STATUS_UNFORMATTED = 1,
4109 #[doc = "Storage present and ready."]
4110 STORAGE_STATUS_READY = 2,
4111 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4112 STORAGE_STATUS_NOT_SUPPORTED = 3,
4113}
4114impl StorageStatus {
4115 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4116}
4117impl Default for StorageStatus {
4118 fn default() -> Self {
4119 Self::DEFAULT
4120 }
4121}
4122#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4124#[cfg_attr(feature = "serde", serde(tag = "type"))]
4125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4126#[repr(u32)]
4127#[doc = "Flags to indicate the type of storage."]
4128pub enum StorageType {
4129 #[doc = "Storage type is not known."]
4130 STORAGE_TYPE_UNKNOWN = 0,
4131 #[doc = "Storage type is USB device."]
4132 STORAGE_TYPE_USB_STICK = 1,
4133 #[doc = "Storage type is SD card."]
4134 STORAGE_TYPE_SD = 2,
4135 #[doc = "Storage type is microSD card."]
4136 STORAGE_TYPE_MICROSD = 3,
4137 #[doc = "Storage type is CFast."]
4138 STORAGE_TYPE_CF = 4,
4139 #[doc = "Storage type is CFexpress."]
4140 STORAGE_TYPE_CFE = 5,
4141 #[doc = "Storage type is XQD."]
4142 STORAGE_TYPE_XQD = 6,
4143 #[doc = "Storage type is HD mass storage type."]
4144 STORAGE_TYPE_HD = 7,
4145 #[doc = "Storage type is other, not listed type."]
4146 STORAGE_TYPE_OTHER = 254,
4147}
4148impl StorageType {
4149 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4150}
4151impl Default for StorageType {
4152 fn default() -> Self {
4153 Self::DEFAULT
4154 }
4155}
4156bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4157impl StorageUsageFlag {
4158 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4159}
4160impl Default for StorageUsageFlag {
4161 fn default() -> Self {
4162 Self::DEFAULT
4163 }
4164}
4165#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4167#[cfg_attr(feature = "serde", serde(tag = "type"))]
4168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4169#[repr(u32)]
4170#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4171pub enum TuneFormat {
4172 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4173 TUNE_FORMAT_QBASIC1_1 = 1,
4174 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4175 TUNE_FORMAT_MML_MODERN = 2,
4176}
4177impl TuneFormat {
4178 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4179}
4180impl Default for TuneFormat {
4181 fn default() -> Self {
4182 Self::DEFAULT
4183 }
4184}
4185#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4187#[cfg_attr(feature = "serde", serde(tag = "type"))]
4188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4189#[repr(u32)]
4190#[doc = "Generalized UAVCAN node health"]
4191pub enum UavcanNodeHealth {
4192 #[doc = "The node is functioning properly."]
4193 UAVCAN_NODE_HEALTH_OK = 0,
4194 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4195 UAVCAN_NODE_HEALTH_WARNING = 1,
4196 #[doc = "The node has encountered a major failure."]
4197 UAVCAN_NODE_HEALTH_ERROR = 2,
4198 #[doc = "The node has suffered a fatal malfunction."]
4199 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4200}
4201impl UavcanNodeHealth {
4202 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4203}
4204impl Default for UavcanNodeHealth {
4205 fn default() -> Self {
4206 Self::DEFAULT
4207 }
4208}
4209#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4211#[cfg_attr(feature = "serde", serde(tag = "type"))]
4212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4213#[repr(u32)]
4214#[doc = "Generalized UAVCAN node mode"]
4215pub enum UavcanNodeMode {
4216 #[doc = "The node is performing its primary functions."]
4217 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4218 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4219 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4220 #[doc = "The node is under maintenance."]
4221 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4222 #[doc = "The node is in the process of updating its software."]
4223 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4224 #[doc = "The node is no longer available online."]
4225 UAVCAN_NODE_MODE_OFFLINE = 7,
4226}
4227impl UavcanNodeMode {
4228 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4229}
4230impl Default for UavcanNodeMode {
4231 fn default() -> Self {
4232 Self::DEFAULT
4233 }
4234}
4235bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4236impl UtmDataAvailFlags {
4237 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4238}
4239impl Default for UtmDataAvailFlags {
4240 fn default() -> Self {
4241 Self::DEFAULT
4242 }
4243}
4244#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4246#[cfg_attr(feature = "serde", serde(tag = "type"))]
4247#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4248#[repr(u32)]
4249#[doc = "Airborne status of UAS."]
4250pub enum UtmFlightState {
4251 #[doc = "The flight state can't be determined."]
4252 UTM_FLIGHT_STATE_UNKNOWN = 1,
4253 #[doc = "UAS on ground."]
4254 UTM_FLIGHT_STATE_GROUND = 2,
4255 #[doc = "UAS airborne."]
4256 UTM_FLIGHT_STATE_AIRBORNE = 3,
4257 #[doc = "UAS is in an emergency flight state."]
4258 UTM_FLIGHT_STATE_EMERGENCY = 16,
4259 #[doc = "UAS has no active controls."]
4260 UTM_FLIGHT_STATE_NOCTRL = 32,
4261}
4262impl UtmFlightState {
4263 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4264}
4265impl Default for UtmFlightState {
4266 fn default() -> Self {
4267 Self::DEFAULT
4268 }
4269}
4270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4272#[cfg_attr(feature = "serde", serde(tag = "type"))]
4273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4274#[repr(u32)]
4275#[doc = "Video stream encodings"]
4276pub enum VideoStreamEncoding {
4277 #[doc = "Stream encoding is unknown"]
4278 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4279 #[doc = "Stream encoding is H.264"]
4280 VIDEO_STREAM_ENCODING_H264 = 1,
4281 #[doc = "Stream encoding is H.265"]
4282 VIDEO_STREAM_ENCODING_H265 = 2,
4283}
4284impl VideoStreamEncoding {
4285 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4286}
4287impl Default for VideoStreamEncoding {
4288 fn default() -> Self {
4289 Self::DEFAULT
4290 }
4291}
4292bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4293impl VideoStreamStatusFlags {
4294 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4295}
4296impl Default for VideoStreamStatusFlags {
4297 fn default() -> Self {
4298 Self::DEFAULT
4299 }
4300}
4301#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4303#[cfg_attr(feature = "serde", serde(tag = "type"))]
4304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4305#[repr(u32)]
4306#[doc = "Video stream types"]
4307pub enum VideoStreamType {
4308 #[doc = "Stream is RTSP"]
4309 VIDEO_STREAM_TYPE_RTSP = 0,
4310 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4311 VIDEO_STREAM_TYPE_RTPUDP = 1,
4312 #[doc = "Stream is MPEG on TCP"]
4313 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4314 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4315 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4316}
4317impl VideoStreamType {
4318 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4319}
4320impl Default for VideoStreamType {
4321 fn default() -> Self {
4322 Self::DEFAULT
4323 }
4324}
4325#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4326#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4327#[cfg_attr(feature = "serde", serde(tag = "type"))]
4328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4329#[repr(u32)]
4330#[doc = "Direction of VTOL transition"]
4331pub enum VtolTransitionHeading {
4332 #[doc = "Respect the heading configuration of the vehicle."]
4333 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4334 #[doc = "Use the heading pointing towards the next waypoint."]
4335 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4336 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4337 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4338 #[doc = "Use the specified heading in parameter 4."]
4339 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4340 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4341 VTOL_TRANSITION_HEADING_ANY = 4,
4342}
4343impl VtolTransitionHeading {
4344 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4345}
4346impl Default for VtolTransitionHeading {
4347 fn default() -> Self {
4348 Self::DEFAULT
4349 }
4350}
4351#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4353#[cfg_attr(feature = "serde", serde(tag = "type"))]
4354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4355#[repr(u32)]
4356#[doc = "WiFi Mode."]
4357pub enum WifiConfigApMode {
4358 #[doc = "WiFi mode is undefined."]
4359 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4360 #[doc = "WiFi configured as an access point."]
4361 WIFI_CONFIG_AP_MODE_AP = 1,
4362 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4363 WIFI_CONFIG_AP_MODE_STATION = 2,
4364 #[doc = "WiFi disabled."]
4365 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4366}
4367impl WifiConfigApMode {
4368 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4369}
4370impl Default for WifiConfigApMode {
4371 fn default() -> Self {
4372 Self::DEFAULT
4373 }
4374}
4375#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4377#[cfg_attr(feature = "serde", serde(tag = "type"))]
4378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4379#[repr(u32)]
4380#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4381pub enum WifiConfigApResponse {
4382 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4383 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4384 #[doc = "Changes accepted."]
4385 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4386 #[doc = "Changes rejected."]
4387 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4388 #[doc = "Invalid Mode."]
4389 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4390 #[doc = "Invalid SSID."]
4391 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4392 #[doc = "Invalid Password."]
4393 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4394}
4395impl WifiConfigApResponse {
4396 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4397}
4398impl Default for WifiConfigApResponse {
4399 fn default() -> Self {
4400 Self::DEFAULT
4401 }
4402}
4403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4405#[cfg_attr(feature = "serde", serde(tag = "type"))]
4406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4407#[repr(u32)]
4408#[doc = "Winch actions."]
4409pub enum WinchActions {
4410 #[doc = "Allow motor to freewheel."]
4411 WINCH_RELAXED = 0,
4412 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4413 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4414 #[doc = "Wind or unwind line at specified rate."]
4415 WINCH_RATE_CONTROL = 2,
4416 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4417 WINCH_LOCK = 3,
4418 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4419 WINCH_DELIVER = 4,
4420 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4421 WINCH_HOLD = 5,
4422 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4423 WINCH_RETRACT = 6,
4424 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4425 WINCH_LOAD_LINE = 7,
4426 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4427 WINCH_ABANDON_LINE = 8,
4428 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4429 WINCH_LOAD_PAYLOAD = 9,
4430}
4431impl WinchActions {
4432 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4433}
4434impl Default for WinchActions {
4435 fn default() -> Self {
4436 Self::DEFAULT
4437 }
4438}
4439#[doc = "Set the vehicle attitude and body angular rates."]
4440#[doc = ""]
4441#[doc = "ID: 140"]
4442#[derive(Debug, Clone, PartialEq)]
4443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4445pub struct ACTUATOR_CONTROL_TARGET_DATA {
4446 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4447 pub time_usec: u64,
4448 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4449 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4450 pub controls: [f32; 8],
4451 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4452 pub group_mlx: u8,
4453}
4454impl ACTUATOR_CONTROL_TARGET_DATA {
4455 pub const ENCODED_LEN: usize = 41usize;
4456 pub const DEFAULT: Self = Self {
4457 time_usec: 0_u64,
4458 controls: [0.0_f32; 8usize],
4459 group_mlx: 0_u8,
4460 };
4461 #[cfg(feature = "arbitrary")]
4462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4463 use arbitrary::{Arbitrary, Unstructured};
4464 let mut buf = [0u8; 1024];
4465 rng.fill_bytes(&mut buf);
4466 let mut unstructured = Unstructured::new(&buf);
4467 Self::arbitrary(&mut unstructured).unwrap_or_default()
4468 }
4469}
4470impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4471 fn default() -> Self {
4472 Self::DEFAULT.clone()
4473 }
4474}
4475impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4476 type Message = MavMessage;
4477 const ID: u32 = 140u32;
4478 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4479 const EXTRA_CRC: u8 = 181u8;
4480 const ENCODED_LEN: usize = 41usize;
4481 fn deser(
4482 _version: MavlinkVersion,
4483 __input: &[u8],
4484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4485 let avail_len = __input.len();
4486 let mut payload_buf = [0; Self::ENCODED_LEN];
4487 let mut buf = if avail_len < Self::ENCODED_LEN {
4488 payload_buf[0..avail_len].copy_from_slice(__input);
4489 Bytes::new(&payload_buf)
4490 } else {
4491 Bytes::new(__input)
4492 };
4493 let mut __struct = Self::default();
4494 __struct.time_usec = buf.get_u64_le();
4495 for v in &mut __struct.controls {
4496 let val = buf.get_f32_le();
4497 *v = val;
4498 }
4499 __struct.group_mlx = buf.get_u8();
4500 Ok(__struct)
4501 }
4502 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4503 let mut __tmp = BytesMut::new(bytes);
4504 #[allow(clippy::absurd_extreme_comparisons)]
4505 #[allow(unused_comparisons)]
4506 if __tmp.remaining() < Self::ENCODED_LEN {
4507 panic!(
4508 "buffer is too small (need {} bytes, but got {})",
4509 Self::ENCODED_LEN,
4510 __tmp.remaining(),
4511 )
4512 }
4513 __tmp.put_u64_le(self.time_usec);
4514 for val in &self.controls {
4515 __tmp.put_f32_le(*val);
4516 }
4517 __tmp.put_u8(self.group_mlx);
4518 if matches!(version, MavlinkVersion::V2) {
4519 let len = __tmp.len();
4520 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4521 } else {
4522 __tmp.len()
4523 }
4524 }
4525}
4526#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4527#[doc = ""]
4528#[doc = "ID: 375"]
4529#[derive(Debug, Clone, PartialEq)]
4530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4532pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4533 #[doc = "Timestamp (since system boot)."]
4534 pub time_usec: u64,
4535 #[doc = "Active outputs"]
4536 pub active: u32,
4537 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4538 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4539 pub actuator: [f32; 32],
4540}
4541impl ACTUATOR_OUTPUT_STATUS_DATA {
4542 pub const ENCODED_LEN: usize = 140usize;
4543 pub const DEFAULT: Self = Self {
4544 time_usec: 0_u64,
4545 active: 0_u32,
4546 actuator: [0.0_f32; 32usize],
4547 };
4548 #[cfg(feature = "arbitrary")]
4549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4550 use arbitrary::{Arbitrary, Unstructured};
4551 let mut buf = [0u8; 1024];
4552 rng.fill_bytes(&mut buf);
4553 let mut unstructured = Unstructured::new(&buf);
4554 Self::arbitrary(&mut unstructured).unwrap_or_default()
4555 }
4556}
4557impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4558 fn default() -> Self {
4559 Self::DEFAULT.clone()
4560 }
4561}
4562impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4563 type Message = MavMessage;
4564 const ID: u32 = 375u32;
4565 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4566 const EXTRA_CRC: u8 = 251u8;
4567 const ENCODED_LEN: usize = 140usize;
4568 fn deser(
4569 _version: MavlinkVersion,
4570 __input: &[u8],
4571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4572 let avail_len = __input.len();
4573 let mut payload_buf = [0; Self::ENCODED_LEN];
4574 let mut buf = if avail_len < Self::ENCODED_LEN {
4575 payload_buf[0..avail_len].copy_from_slice(__input);
4576 Bytes::new(&payload_buf)
4577 } else {
4578 Bytes::new(__input)
4579 };
4580 let mut __struct = Self::default();
4581 __struct.time_usec = buf.get_u64_le();
4582 __struct.active = buf.get_u32_le();
4583 for v in &mut __struct.actuator {
4584 let val = buf.get_f32_le();
4585 *v = val;
4586 }
4587 Ok(__struct)
4588 }
4589 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4590 let mut __tmp = BytesMut::new(bytes);
4591 #[allow(clippy::absurd_extreme_comparisons)]
4592 #[allow(unused_comparisons)]
4593 if __tmp.remaining() < Self::ENCODED_LEN {
4594 panic!(
4595 "buffer is too small (need {} bytes, but got {})",
4596 Self::ENCODED_LEN,
4597 __tmp.remaining(),
4598 )
4599 }
4600 __tmp.put_u64_le(self.time_usec);
4601 __tmp.put_u32_le(self.active);
4602 for val in &self.actuator {
4603 __tmp.put_f32_le(*val);
4604 }
4605 if matches!(version, MavlinkVersion::V2) {
4606 let len = __tmp.len();
4607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4608 } else {
4609 __tmp.len()
4610 }
4611 }
4612}
4613#[doc = "The location and information of an ADSB vehicle."]
4614#[doc = ""]
4615#[doc = "ID: 246"]
4616#[derive(Debug, Clone, PartialEq)]
4617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4619pub struct ADSB_VEHICLE_DATA {
4620 #[doc = "ICAO address"]
4621 pub ICAO_address: u32,
4622 #[doc = "Latitude"]
4623 pub lat: i32,
4624 #[doc = "Longitude"]
4625 pub lon: i32,
4626 #[doc = "Altitude(ASL)"]
4627 pub altitude: i32,
4628 #[doc = "Course over ground"]
4629 pub heading: u16,
4630 #[doc = "The horizontal velocity"]
4631 pub hor_velocity: u16,
4632 #[doc = "The vertical velocity. Positive is up"]
4633 pub ver_velocity: i16,
4634 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4635 pub flags: AdsbFlags,
4636 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4637 pub squawk: u16,
4638 #[doc = "ADSB altitude type."]
4639 pub altitude_type: AdsbAltitudeType,
4640 #[doc = "The callsign, 8+null"]
4641 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4642 pub callsign: [u8; 9],
4643 #[doc = "ADSB emitter type."]
4644 pub emitter_type: AdsbEmitterType,
4645 #[doc = "Time since last communication in seconds"]
4646 pub tslc: u8,
4647}
4648impl ADSB_VEHICLE_DATA {
4649 pub const ENCODED_LEN: usize = 38usize;
4650 pub const DEFAULT: Self = Self {
4651 ICAO_address: 0_u32,
4652 lat: 0_i32,
4653 lon: 0_i32,
4654 altitude: 0_i32,
4655 heading: 0_u16,
4656 hor_velocity: 0_u16,
4657 ver_velocity: 0_i16,
4658 flags: AdsbFlags::DEFAULT,
4659 squawk: 0_u16,
4660 altitude_type: AdsbAltitudeType::DEFAULT,
4661 callsign: [0_u8; 9usize],
4662 emitter_type: AdsbEmitterType::DEFAULT,
4663 tslc: 0_u8,
4664 };
4665 #[cfg(feature = "arbitrary")]
4666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4667 use arbitrary::{Arbitrary, Unstructured};
4668 let mut buf = [0u8; 1024];
4669 rng.fill_bytes(&mut buf);
4670 let mut unstructured = Unstructured::new(&buf);
4671 Self::arbitrary(&mut unstructured).unwrap_or_default()
4672 }
4673}
4674impl Default for ADSB_VEHICLE_DATA {
4675 fn default() -> Self {
4676 Self::DEFAULT.clone()
4677 }
4678}
4679impl MessageData for ADSB_VEHICLE_DATA {
4680 type Message = MavMessage;
4681 const ID: u32 = 246u32;
4682 const NAME: &'static str = "ADSB_VEHICLE";
4683 const EXTRA_CRC: u8 = 184u8;
4684 const ENCODED_LEN: usize = 38usize;
4685 fn deser(
4686 _version: MavlinkVersion,
4687 __input: &[u8],
4688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4689 let avail_len = __input.len();
4690 let mut payload_buf = [0; Self::ENCODED_LEN];
4691 let mut buf = if avail_len < Self::ENCODED_LEN {
4692 payload_buf[0..avail_len].copy_from_slice(__input);
4693 Bytes::new(&payload_buf)
4694 } else {
4695 Bytes::new(__input)
4696 };
4697 let mut __struct = Self::default();
4698 __struct.ICAO_address = buf.get_u32_le();
4699 __struct.lat = buf.get_i32_le();
4700 __struct.lon = buf.get_i32_le();
4701 __struct.altitude = buf.get_i32_le();
4702 __struct.heading = buf.get_u16_le();
4703 __struct.hor_velocity = buf.get_u16_le();
4704 __struct.ver_velocity = buf.get_i16_le();
4705 let tmp = buf.get_u16_le();
4706 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4707 ::mavlink_core::error::ParserError::InvalidFlag {
4708 flag_type: "AdsbFlags",
4709 value: tmp as u32,
4710 },
4711 )?;
4712 __struct.squawk = buf.get_u16_le();
4713 let tmp = buf.get_u8();
4714 __struct.altitude_type =
4715 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4716 enum_type: "AdsbAltitudeType",
4717 value: tmp as u32,
4718 })?;
4719 for v in &mut __struct.callsign {
4720 let val = buf.get_u8();
4721 *v = val;
4722 }
4723 let tmp = buf.get_u8();
4724 __struct.emitter_type =
4725 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4726 enum_type: "AdsbEmitterType",
4727 value: tmp as u32,
4728 })?;
4729 __struct.tslc = buf.get_u8();
4730 Ok(__struct)
4731 }
4732 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4733 let mut __tmp = BytesMut::new(bytes);
4734 #[allow(clippy::absurd_extreme_comparisons)]
4735 #[allow(unused_comparisons)]
4736 if __tmp.remaining() < Self::ENCODED_LEN {
4737 panic!(
4738 "buffer is too small (need {} bytes, but got {})",
4739 Self::ENCODED_LEN,
4740 __tmp.remaining(),
4741 )
4742 }
4743 __tmp.put_u32_le(self.ICAO_address);
4744 __tmp.put_i32_le(self.lat);
4745 __tmp.put_i32_le(self.lon);
4746 __tmp.put_i32_le(self.altitude);
4747 __tmp.put_u16_le(self.heading);
4748 __tmp.put_u16_le(self.hor_velocity);
4749 __tmp.put_i16_le(self.ver_velocity);
4750 __tmp.put_u16_le(self.flags.bits());
4751 __tmp.put_u16_le(self.squawk);
4752 __tmp.put_u8(self.altitude_type as u8);
4753 for val in &self.callsign {
4754 __tmp.put_u8(*val);
4755 }
4756 __tmp.put_u8(self.emitter_type as u8);
4757 __tmp.put_u8(self.tslc);
4758 if matches!(version, MavlinkVersion::V2) {
4759 let len = __tmp.len();
4760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4761 } else {
4762 __tmp.len()
4763 }
4764 }
4765}
4766#[doc = "The location and information of an AIS vessel."]
4767#[doc = ""]
4768#[doc = "ID: 301"]
4769#[derive(Debug, Clone, PartialEq)]
4770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4772pub struct AIS_VESSEL_DATA {
4773 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4774 pub MMSI: u32,
4775 #[doc = "Latitude"]
4776 pub lat: i32,
4777 #[doc = "Longitude"]
4778 pub lon: i32,
4779 #[doc = "Course over ground"]
4780 pub COG: u16,
4781 #[doc = "True heading"]
4782 pub heading: u16,
4783 #[doc = "Speed over ground"]
4784 pub velocity: u16,
4785 #[doc = "Distance from lat/lon location to bow"]
4786 pub dimension_bow: u16,
4787 #[doc = "Distance from lat/lon location to stern"]
4788 pub dimension_stern: u16,
4789 #[doc = "Time since last communication in seconds"]
4790 pub tslc: u16,
4791 #[doc = "Bitmask to indicate various statuses including valid data fields"]
4792 pub flags: AisFlags,
4793 #[doc = "Turn rate"]
4794 pub turn_rate: i8,
4795 #[doc = "Navigational status"]
4796 pub navigational_status: AisNavStatus,
4797 #[doc = "Type of vessels"]
4798 pub mavtype: AisType,
4799 #[doc = "Distance from lat/lon location to port side"]
4800 pub dimension_port: u8,
4801 #[doc = "Distance from lat/lon location to starboard side"]
4802 pub dimension_starboard: u8,
4803 #[doc = "The vessel callsign"]
4804 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4805 pub callsign: [u8; 7],
4806 #[doc = "The vessel name"]
4807 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4808 pub name: [u8; 20],
4809}
4810impl AIS_VESSEL_DATA {
4811 pub const ENCODED_LEN: usize = 58usize;
4812 pub const DEFAULT: Self = Self {
4813 MMSI: 0_u32,
4814 lat: 0_i32,
4815 lon: 0_i32,
4816 COG: 0_u16,
4817 heading: 0_u16,
4818 velocity: 0_u16,
4819 dimension_bow: 0_u16,
4820 dimension_stern: 0_u16,
4821 tslc: 0_u16,
4822 flags: AisFlags::DEFAULT,
4823 turn_rate: 0_i8,
4824 navigational_status: AisNavStatus::DEFAULT,
4825 mavtype: AisType::DEFAULT,
4826 dimension_port: 0_u8,
4827 dimension_starboard: 0_u8,
4828 callsign: [0_u8; 7usize],
4829 name: [0_u8; 20usize],
4830 };
4831 #[cfg(feature = "arbitrary")]
4832 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4833 use arbitrary::{Arbitrary, Unstructured};
4834 let mut buf = [0u8; 1024];
4835 rng.fill_bytes(&mut buf);
4836 let mut unstructured = Unstructured::new(&buf);
4837 Self::arbitrary(&mut unstructured).unwrap_or_default()
4838 }
4839}
4840impl Default for AIS_VESSEL_DATA {
4841 fn default() -> Self {
4842 Self::DEFAULT.clone()
4843 }
4844}
4845impl MessageData for AIS_VESSEL_DATA {
4846 type Message = MavMessage;
4847 const ID: u32 = 301u32;
4848 const NAME: &'static str = "AIS_VESSEL";
4849 const EXTRA_CRC: u8 = 243u8;
4850 const ENCODED_LEN: usize = 58usize;
4851 fn deser(
4852 _version: MavlinkVersion,
4853 __input: &[u8],
4854 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4855 let avail_len = __input.len();
4856 let mut payload_buf = [0; Self::ENCODED_LEN];
4857 let mut buf = if avail_len < Self::ENCODED_LEN {
4858 payload_buf[0..avail_len].copy_from_slice(__input);
4859 Bytes::new(&payload_buf)
4860 } else {
4861 Bytes::new(__input)
4862 };
4863 let mut __struct = Self::default();
4864 __struct.MMSI = buf.get_u32_le();
4865 __struct.lat = buf.get_i32_le();
4866 __struct.lon = buf.get_i32_le();
4867 __struct.COG = buf.get_u16_le();
4868 __struct.heading = buf.get_u16_le();
4869 __struct.velocity = buf.get_u16_le();
4870 __struct.dimension_bow = buf.get_u16_le();
4871 __struct.dimension_stern = buf.get_u16_le();
4872 __struct.tslc = buf.get_u16_le();
4873 let tmp = buf.get_u16_le();
4874 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
4875 ::mavlink_core::error::ParserError::InvalidFlag {
4876 flag_type: "AisFlags",
4877 value: tmp as u32,
4878 },
4879 )?;
4880 __struct.turn_rate = buf.get_i8();
4881 let tmp = buf.get_u8();
4882 __struct.navigational_status =
4883 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4884 enum_type: "AisNavStatus",
4885 value: tmp as u32,
4886 })?;
4887 let tmp = buf.get_u8();
4888 __struct.mavtype =
4889 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4890 enum_type: "AisType",
4891 value: tmp as u32,
4892 })?;
4893 __struct.dimension_port = buf.get_u8();
4894 __struct.dimension_starboard = buf.get_u8();
4895 for v in &mut __struct.callsign {
4896 let val = buf.get_u8();
4897 *v = val;
4898 }
4899 for v in &mut __struct.name {
4900 let val = buf.get_u8();
4901 *v = val;
4902 }
4903 Ok(__struct)
4904 }
4905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4906 let mut __tmp = BytesMut::new(bytes);
4907 #[allow(clippy::absurd_extreme_comparisons)]
4908 #[allow(unused_comparisons)]
4909 if __tmp.remaining() < Self::ENCODED_LEN {
4910 panic!(
4911 "buffer is too small (need {} bytes, but got {})",
4912 Self::ENCODED_LEN,
4913 __tmp.remaining(),
4914 )
4915 }
4916 __tmp.put_u32_le(self.MMSI);
4917 __tmp.put_i32_le(self.lat);
4918 __tmp.put_i32_le(self.lon);
4919 __tmp.put_u16_le(self.COG);
4920 __tmp.put_u16_le(self.heading);
4921 __tmp.put_u16_le(self.velocity);
4922 __tmp.put_u16_le(self.dimension_bow);
4923 __tmp.put_u16_le(self.dimension_stern);
4924 __tmp.put_u16_le(self.tslc);
4925 __tmp.put_u16_le(self.flags.bits());
4926 __tmp.put_i8(self.turn_rate);
4927 __tmp.put_u8(self.navigational_status as u8);
4928 __tmp.put_u8(self.mavtype as u8);
4929 __tmp.put_u8(self.dimension_port);
4930 __tmp.put_u8(self.dimension_starboard);
4931 for val in &self.callsign {
4932 __tmp.put_u8(*val);
4933 }
4934 for val in &self.name {
4935 __tmp.put_u8(*val);
4936 }
4937 if matches!(version, MavlinkVersion::V2) {
4938 let len = __tmp.len();
4939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4940 } else {
4941 __tmp.len()
4942 }
4943 }
4944}
4945#[doc = "The current system altitude."]
4946#[doc = ""]
4947#[doc = "ID: 141"]
4948#[derive(Debug, Clone, PartialEq)]
4949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4951pub struct ALTITUDE_DATA {
4952 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4953 pub time_usec: u64,
4954 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
4955 pub altitude_monotonic: f32,
4956 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
4957 pub altitude_amsl: f32,
4958 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
4959 pub altitude_local: f32,
4960 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
4961 pub altitude_relative: f32,
4962 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
4963 pub altitude_terrain: f32,
4964 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
4965 pub bottom_clearance: f32,
4966}
4967impl ALTITUDE_DATA {
4968 pub const ENCODED_LEN: usize = 32usize;
4969 pub const DEFAULT: Self = Self {
4970 time_usec: 0_u64,
4971 altitude_monotonic: 0.0_f32,
4972 altitude_amsl: 0.0_f32,
4973 altitude_local: 0.0_f32,
4974 altitude_relative: 0.0_f32,
4975 altitude_terrain: 0.0_f32,
4976 bottom_clearance: 0.0_f32,
4977 };
4978 #[cfg(feature = "arbitrary")]
4979 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4980 use arbitrary::{Arbitrary, Unstructured};
4981 let mut buf = [0u8; 1024];
4982 rng.fill_bytes(&mut buf);
4983 let mut unstructured = Unstructured::new(&buf);
4984 Self::arbitrary(&mut unstructured).unwrap_or_default()
4985 }
4986}
4987impl Default for ALTITUDE_DATA {
4988 fn default() -> Self {
4989 Self::DEFAULT.clone()
4990 }
4991}
4992impl MessageData for ALTITUDE_DATA {
4993 type Message = MavMessage;
4994 const ID: u32 = 141u32;
4995 const NAME: &'static str = "ALTITUDE";
4996 const EXTRA_CRC: u8 = 47u8;
4997 const ENCODED_LEN: usize = 32usize;
4998 fn deser(
4999 _version: MavlinkVersion,
5000 __input: &[u8],
5001 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5002 let avail_len = __input.len();
5003 let mut payload_buf = [0; Self::ENCODED_LEN];
5004 let mut buf = if avail_len < Self::ENCODED_LEN {
5005 payload_buf[0..avail_len].copy_from_slice(__input);
5006 Bytes::new(&payload_buf)
5007 } else {
5008 Bytes::new(__input)
5009 };
5010 let mut __struct = Self::default();
5011 __struct.time_usec = buf.get_u64_le();
5012 __struct.altitude_monotonic = buf.get_f32_le();
5013 __struct.altitude_amsl = buf.get_f32_le();
5014 __struct.altitude_local = buf.get_f32_le();
5015 __struct.altitude_relative = buf.get_f32_le();
5016 __struct.altitude_terrain = buf.get_f32_le();
5017 __struct.bottom_clearance = buf.get_f32_le();
5018 Ok(__struct)
5019 }
5020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5021 let mut __tmp = BytesMut::new(bytes);
5022 #[allow(clippy::absurd_extreme_comparisons)]
5023 #[allow(unused_comparisons)]
5024 if __tmp.remaining() < Self::ENCODED_LEN {
5025 panic!(
5026 "buffer is too small (need {} bytes, but got {})",
5027 Self::ENCODED_LEN,
5028 __tmp.remaining(),
5029 )
5030 }
5031 __tmp.put_u64_le(self.time_usec);
5032 __tmp.put_f32_le(self.altitude_monotonic);
5033 __tmp.put_f32_le(self.altitude_amsl);
5034 __tmp.put_f32_le(self.altitude_local);
5035 __tmp.put_f32_le(self.altitude_relative);
5036 __tmp.put_f32_le(self.altitude_terrain);
5037 __tmp.put_f32_le(self.bottom_clearance);
5038 if matches!(version, MavlinkVersion::V2) {
5039 let len = __tmp.len();
5040 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5041 } else {
5042 __tmp.len()
5043 }
5044 }
5045}
5046#[doc = "Array test #0."]
5047#[doc = ""]
5048#[doc = "ID: 17150"]
5049#[derive(Debug, Clone, PartialEq)]
5050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5052pub struct ARRAY_TEST_0_DATA {
5053 #[doc = "Value array"]
5054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5055 pub ar_u32: [u32; 4],
5056 #[doc = "Value array"]
5057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5058 pub ar_u16: [u16; 4],
5059 #[doc = "Stub field"]
5060 pub v1: u8,
5061 #[doc = "Value array"]
5062 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5063 pub ar_i8: [i8; 4],
5064 #[doc = "Value array"]
5065 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5066 pub ar_u8: [u8; 4],
5067}
5068impl ARRAY_TEST_0_DATA {
5069 pub const ENCODED_LEN: usize = 33usize;
5070 pub const DEFAULT: Self = Self {
5071 ar_u32: [0_u32; 4usize],
5072 ar_u16: [0_u16; 4usize],
5073 v1: 0_u8,
5074 ar_i8: [0_i8; 4usize],
5075 ar_u8: [0_u8; 4usize],
5076 };
5077 #[cfg(feature = "arbitrary")]
5078 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5079 use arbitrary::{Arbitrary, Unstructured};
5080 let mut buf = [0u8; 1024];
5081 rng.fill_bytes(&mut buf);
5082 let mut unstructured = Unstructured::new(&buf);
5083 Self::arbitrary(&mut unstructured).unwrap_or_default()
5084 }
5085}
5086impl Default for ARRAY_TEST_0_DATA {
5087 fn default() -> Self {
5088 Self::DEFAULT.clone()
5089 }
5090}
5091impl MessageData for ARRAY_TEST_0_DATA {
5092 type Message = MavMessage;
5093 const ID: u32 = 17150u32;
5094 const NAME: &'static str = "ARRAY_TEST_0";
5095 const EXTRA_CRC: u8 = 26u8;
5096 const ENCODED_LEN: usize = 33usize;
5097 fn deser(
5098 _version: MavlinkVersion,
5099 __input: &[u8],
5100 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5101 let avail_len = __input.len();
5102 let mut payload_buf = [0; Self::ENCODED_LEN];
5103 let mut buf = if avail_len < Self::ENCODED_LEN {
5104 payload_buf[0..avail_len].copy_from_slice(__input);
5105 Bytes::new(&payload_buf)
5106 } else {
5107 Bytes::new(__input)
5108 };
5109 let mut __struct = Self::default();
5110 for v in &mut __struct.ar_u32 {
5111 let val = buf.get_u32_le();
5112 *v = val;
5113 }
5114 for v in &mut __struct.ar_u16 {
5115 let val = buf.get_u16_le();
5116 *v = val;
5117 }
5118 __struct.v1 = buf.get_u8();
5119 for v in &mut __struct.ar_i8 {
5120 let val = buf.get_i8();
5121 *v = val;
5122 }
5123 for v in &mut __struct.ar_u8 {
5124 let val = buf.get_u8();
5125 *v = val;
5126 }
5127 Ok(__struct)
5128 }
5129 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5130 let mut __tmp = BytesMut::new(bytes);
5131 #[allow(clippy::absurd_extreme_comparisons)]
5132 #[allow(unused_comparisons)]
5133 if __tmp.remaining() < Self::ENCODED_LEN {
5134 panic!(
5135 "buffer is too small (need {} bytes, but got {})",
5136 Self::ENCODED_LEN,
5137 __tmp.remaining(),
5138 )
5139 }
5140 for val in &self.ar_u32 {
5141 __tmp.put_u32_le(*val);
5142 }
5143 for val in &self.ar_u16 {
5144 __tmp.put_u16_le(*val);
5145 }
5146 __tmp.put_u8(self.v1);
5147 for val in &self.ar_i8 {
5148 __tmp.put_i8(*val);
5149 }
5150 for val in &self.ar_u8 {
5151 __tmp.put_u8(*val);
5152 }
5153 if matches!(version, MavlinkVersion::V2) {
5154 let len = __tmp.len();
5155 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5156 } else {
5157 __tmp.len()
5158 }
5159 }
5160}
5161#[doc = "Array test #1."]
5162#[doc = ""]
5163#[doc = "ID: 17151"]
5164#[derive(Debug, Clone, PartialEq)]
5165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5167pub struct ARRAY_TEST_1_DATA {
5168 #[doc = "Value array"]
5169 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5170 pub ar_u32: [u32; 4],
5171}
5172impl ARRAY_TEST_1_DATA {
5173 pub const ENCODED_LEN: usize = 16usize;
5174 pub const DEFAULT: Self = Self {
5175 ar_u32: [0_u32; 4usize],
5176 };
5177 #[cfg(feature = "arbitrary")]
5178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5179 use arbitrary::{Arbitrary, Unstructured};
5180 let mut buf = [0u8; 1024];
5181 rng.fill_bytes(&mut buf);
5182 let mut unstructured = Unstructured::new(&buf);
5183 Self::arbitrary(&mut unstructured).unwrap_or_default()
5184 }
5185}
5186impl Default for ARRAY_TEST_1_DATA {
5187 fn default() -> Self {
5188 Self::DEFAULT.clone()
5189 }
5190}
5191impl MessageData for ARRAY_TEST_1_DATA {
5192 type Message = MavMessage;
5193 const ID: u32 = 17151u32;
5194 const NAME: &'static str = "ARRAY_TEST_1";
5195 const EXTRA_CRC: u8 = 72u8;
5196 const ENCODED_LEN: usize = 16usize;
5197 fn deser(
5198 _version: MavlinkVersion,
5199 __input: &[u8],
5200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5201 let avail_len = __input.len();
5202 let mut payload_buf = [0; Self::ENCODED_LEN];
5203 let mut buf = if avail_len < Self::ENCODED_LEN {
5204 payload_buf[0..avail_len].copy_from_slice(__input);
5205 Bytes::new(&payload_buf)
5206 } else {
5207 Bytes::new(__input)
5208 };
5209 let mut __struct = Self::default();
5210 for v in &mut __struct.ar_u32 {
5211 let val = buf.get_u32_le();
5212 *v = val;
5213 }
5214 Ok(__struct)
5215 }
5216 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5217 let mut __tmp = BytesMut::new(bytes);
5218 #[allow(clippy::absurd_extreme_comparisons)]
5219 #[allow(unused_comparisons)]
5220 if __tmp.remaining() < Self::ENCODED_LEN {
5221 panic!(
5222 "buffer is too small (need {} bytes, but got {})",
5223 Self::ENCODED_LEN,
5224 __tmp.remaining(),
5225 )
5226 }
5227 for val in &self.ar_u32 {
5228 __tmp.put_u32_le(*val);
5229 }
5230 if matches!(version, MavlinkVersion::V2) {
5231 let len = __tmp.len();
5232 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5233 } else {
5234 __tmp.len()
5235 }
5236 }
5237}
5238#[doc = "Array test #3."]
5239#[doc = ""]
5240#[doc = "ID: 17153"]
5241#[derive(Debug, Clone, PartialEq)]
5242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5244pub struct ARRAY_TEST_3_DATA {
5245 #[doc = "Value array"]
5246 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5247 pub ar_u32: [u32; 4],
5248 #[doc = "Stub field"]
5249 pub v: u8,
5250}
5251impl ARRAY_TEST_3_DATA {
5252 pub const ENCODED_LEN: usize = 17usize;
5253 pub const DEFAULT: Self = Self {
5254 ar_u32: [0_u32; 4usize],
5255 v: 0_u8,
5256 };
5257 #[cfg(feature = "arbitrary")]
5258 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5259 use arbitrary::{Arbitrary, Unstructured};
5260 let mut buf = [0u8; 1024];
5261 rng.fill_bytes(&mut buf);
5262 let mut unstructured = Unstructured::new(&buf);
5263 Self::arbitrary(&mut unstructured).unwrap_or_default()
5264 }
5265}
5266impl Default for ARRAY_TEST_3_DATA {
5267 fn default() -> Self {
5268 Self::DEFAULT.clone()
5269 }
5270}
5271impl MessageData for ARRAY_TEST_3_DATA {
5272 type Message = MavMessage;
5273 const ID: u32 = 17153u32;
5274 const NAME: &'static str = "ARRAY_TEST_3";
5275 const EXTRA_CRC: u8 = 19u8;
5276 const ENCODED_LEN: usize = 17usize;
5277 fn deser(
5278 _version: MavlinkVersion,
5279 __input: &[u8],
5280 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5281 let avail_len = __input.len();
5282 let mut payload_buf = [0; Self::ENCODED_LEN];
5283 let mut buf = if avail_len < Self::ENCODED_LEN {
5284 payload_buf[0..avail_len].copy_from_slice(__input);
5285 Bytes::new(&payload_buf)
5286 } else {
5287 Bytes::new(__input)
5288 };
5289 let mut __struct = Self::default();
5290 for v in &mut __struct.ar_u32 {
5291 let val = buf.get_u32_le();
5292 *v = val;
5293 }
5294 __struct.v = buf.get_u8();
5295 Ok(__struct)
5296 }
5297 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5298 let mut __tmp = BytesMut::new(bytes);
5299 #[allow(clippy::absurd_extreme_comparisons)]
5300 #[allow(unused_comparisons)]
5301 if __tmp.remaining() < Self::ENCODED_LEN {
5302 panic!(
5303 "buffer is too small (need {} bytes, but got {})",
5304 Self::ENCODED_LEN,
5305 __tmp.remaining(),
5306 )
5307 }
5308 for val in &self.ar_u32 {
5309 __tmp.put_u32_le(*val);
5310 }
5311 __tmp.put_u8(self.v);
5312 if matches!(version, MavlinkVersion::V2) {
5313 let len = __tmp.len();
5314 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5315 } else {
5316 __tmp.len()
5317 }
5318 }
5319}
5320#[doc = "Array test #4."]
5321#[doc = ""]
5322#[doc = "ID: 17154"]
5323#[derive(Debug, Clone, PartialEq)]
5324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5326pub struct ARRAY_TEST_4_DATA {
5327 #[doc = "Value array"]
5328 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5329 pub ar_u32: [u32; 4],
5330 #[doc = "Stub field"]
5331 pub v: u8,
5332}
5333impl ARRAY_TEST_4_DATA {
5334 pub const ENCODED_LEN: usize = 17usize;
5335 pub const DEFAULT: Self = Self {
5336 ar_u32: [0_u32; 4usize],
5337 v: 0_u8,
5338 };
5339 #[cfg(feature = "arbitrary")]
5340 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5341 use arbitrary::{Arbitrary, Unstructured};
5342 let mut buf = [0u8; 1024];
5343 rng.fill_bytes(&mut buf);
5344 let mut unstructured = Unstructured::new(&buf);
5345 Self::arbitrary(&mut unstructured).unwrap_or_default()
5346 }
5347}
5348impl Default for ARRAY_TEST_4_DATA {
5349 fn default() -> Self {
5350 Self::DEFAULT.clone()
5351 }
5352}
5353impl MessageData for ARRAY_TEST_4_DATA {
5354 type Message = MavMessage;
5355 const ID: u32 = 17154u32;
5356 const NAME: &'static str = "ARRAY_TEST_4";
5357 const EXTRA_CRC: u8 = 89u8;
5358 const ENCODED_LEN: usize = 17usize;
5359 fn deser(
5360 _version: MavlinkVersion,
5361 __input: &[u8],
5362 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5363 let avail_len = __input.len();
5364 let mut payload_buf = [0; Self::ENCODED_LEN];
5365 let mut buf = if avail_len < Self::ENCODED_LEN {
5366 payload_buf[0..avail_len].copy_from_slice(__input);
5367 Bytes::new(&payload_buf)
5368 } else {
5369 Bytes::new(__input)
5370 };
5371 let mut __struct = Self::default();
5372 for v in &mut __struct.ar_u32 {
5373 let val = buf.get_u32_le();
5374 *v = val;
5375 }
5376 __struct.v = buf.get_u8();
5377 Ok(__struct)
5378 }
5379 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5380 let mut __tmp = BytesMut::new(bytes);
5381 #[allow(clippy::absurd_extreme_comparisons)]
5382 #[allow(unused_comparisons)]
5383 if __tmp.remaining() < Self::ENCODED_LEN {
5384 panic!(
5385 "buffer is too small (need {} bytes, but got {})",
5386 Self::ENCODED_LEN,
5387 __tmp.remaining(),
5388 )
5389 }
5390 for val in &self.ar_u32 {
5391 __tmp.put_u32_le(*val);
5392 }
5393 __tmp.put_u8(self.v);
5394 if matches!(version, MavlinkVersion::V2) {
5395 let len = __tmp.len();
5396 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5397 } else {
5398 __tmp.len()
5399 }
5400 }
5401}
5402#[doc = "Array test #5."]
5403#[doc = ""]
5404#[doc = "ID: 17155"]
5405#[derive(Debug, Clone, PartialEq)]
5406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5408pub struct ARRAY_TEST_5_DATA {
5409 #[doc = "Value array"]
5410 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5411 pub c1: [u8; 5],
5412 #[doc = "Value array"]
5413 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5414 pub c2: [u8; 5],
5415}
5416impl ARRAY_TEST_5_DATA {
5417 pub const ENCODED_LEN: usize = 10usize;
5418 pub const DEFAULT: Self = Self {
5419 c1: [0_u8; 5usize],
5420 c2: [0_u8; 5usize],
5421 };
5422 #[cfg(feature = "arbitrary")]
5423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5424 use arbitrary::{Arbitrary, Unstructured};
5425 let mut buf = [0u8; 1024];
5426 rng.fill_bytes(&mut buf);
5427 let mut unstructured = Unstructured::new(&buf);
5428 Self::arbitrary(&mut unstructured).unwrap_or_default()
5429 }
5430}
5431impl Default for ARRAY_TEST_5_DATA {
5432 fn default() -> Self {
5433 Self::DEFAULT.clone()
5434 }
5435}
5436impl MessageData for ARRAY_TEST_5_DATA {
5437 type Message = MavMessage;
5438 const ID: u32 = 17155u32;
5439 const NAME: &'static str = "ARRAY_TEST_5";
5440 const EXTRA_CRC: u8 = 27u8;
5441 const ENCODED_LEN: usize = 10usize;
5442 fn deser(
5443 _version: MavlinkVersion,
5444 __input: &[u8],
5445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5446 let avail_len = __input.len();
5447 let mut payload_buf = [0; Self::ENCODED_LEN];
5448 let mut buf = if avail_len < Self::ENCODED_LEN {
5449 payload_buf[0..avail_len].copy_from_slice(__input);
5450 Bytes::new(&payload_buf)
5451 } else {
5452 Bytes::new(__input)
5453 };
5454 let mut __struct = Self::default();
5455 for v in &mut __struct.c1 {
5456 let val = buf.get_u8();
5457 *v = val;
5458 }
5459 for v in &mut __struct.c2 {
5460 let val = buf.get_u8();
5461 *v = val;
5462 }
5463 Ok(__struct)
5464 }
5465 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5466 let mut __tmp = BytesMut::new(bytes);
5467 #[allow(clippy::absurd_extreme_comparisons)]
5468 #[allow(unused_comparisons)]
5469 if __tmp.remaining() < Self::ENCODED_LEN {
5470 panic!(
5471 "buffer is too small (need {} bytes, but got {})",
5472 Self::ENCODED_LEN,
5473 __tmp.remaining(),
5474 )
5475 }
5476 for val in &self.c1 {
5477 __tmp.put_u8(*val);
5478 }
5479 for val in &self.c2 {
5480 __tmp.put_u8(*val);
5481 }
5482 if matches!(version, MavlinkVersion::V2) {
5483 let len = __tmp.len();
5484 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5485 } else {
5486 __tmp.len()
5487 }
5488 }
5489}
5490#[doc = "Array test #6."]
5491#[doc = ""]
5492#[doc = "ID: 17156"]
5493#[derive(Debug, Clone, PartialEq)]
5494#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5495#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5496pub struct ARRAY_TEST_6_DATA {
5497 #[doc = "Value array"]
5498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5499 pub ar_d: [f64; 2],
5500 #[doc = "Stub field"]
5501 pub v3: u32,
5502 #[doc = "Value array"]
5503 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5504 pub ar_u32: [u32; 2],
5505 #[doc = "Value array"]
5506 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5507 pub ar_i32: [i32; 2],
5508 #[doc = "Value array"]
5509 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5510 pub ar_f: [f32; 2],
5511 #[doc = "Stub field"]
5512 pub v2: u16,
5513 #[doc = "Value array"]
5514 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5515 pub ar_u16: [u16; 2],
5516 #[doc = "Value array"]
5517 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5518 pub ar_i16: [i16; 2],
5519 #[doc = "Stub field"]
5520 pub v1: u8,
5521 #[doc = "Value array"]
5522 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5523 pub ar_u8: [u8; 2],
5524 #[doc = "Value array"]
5525 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5526 pub ar_i8: [i8; 2],
5527 #[doc = "Value array"]
5528 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5529 pub ar_c: [u8; 32],
5530}
5531impl ARRAY_TEST_6_DATA {
5532 pub const ENCODED_LEN: usize = 91usize;
5533 pub const DEFAULT: Self = Self {
5534 ar_d: [0.0_f64; 2usize],
5535 v3: 0_u32,
5536 ar_u32: [0_u32; 2usize],
5537 ar_i32: [0_i32; 2usize],
5538 ar_f: [0.0_f32; 2usize],
5539 v2: 0_u16,
5540 ar_u16: [0_u16; 2usize],
5541 ar_i16: [0_i16; 2usize],
5542 v1: 0_u8,
5543 ar_u8: [0_u8; 2usize],
5544 ar_i8: [0_i8; 2usize],
5545 ar_c: [0_u8; 32usize],
5546 };
5547 #[cfg(feature = "arbitrary")]
5548 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5549 use arbitrary::{Arbitrary, Unstructured};
5550 let mut buf = [0u8; 1024];
5551 rng.fill_bytes(&mut buf);
5552 let mut unstructured = Unstructured::new(&buf);
5553 Self::arbitrary(&mut unstructured).unwrap_or_default()
5554 }
5555}
5556impl Default for ARRAY_TEST_6_DATA {
5557 fn default() -> Self {
5558 Self::DEFAULT.clone()
5559 }
5560}
5561impl MessageData for ARRAY_TEST_6_DATA {
5562 type Message = MavMessage;
5563 const ID: u32 = 17156u32;
5564 const NAME: &'static str = "ARRAY_TEST_6";
5565 const EXTRA_CRC: u8 = 14u8;
5566 const ENCODED_LEN: usize = 91usize;
5567 fn deser(
5568 _version: MavlinkVersion,
5569 __input: &[u8],
5570 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5571 let avail_len = __input.len();
5572 let mut payload_buf = [0; Self::ENCODED_LEN];
5573 let mut buf = if avail_len < Self::ENCODED_LEN {
5574 payload_buf[0..avail_len].copy_from_slice(__input);
5575 Bytes::new(&payload_buf)
5576 } else {
5577 Bytes::new(__input)
5578 };
5579 let mut __struct = Self::default();
5580 for v in &mut __struct.ar_d {
5581 let val = buf.get_f64_le();
5582 *v = val;
5583 }
5584 __struct.v3 = buf.get_u32_le();
5585 for v in &mut __struct.ar_u32 {
5586 let val = buf.get_u32_le();
5587 *v = val;
5588 }
5589 for v in &mut __struct.ar_i32 {
5590 let val = buf.get_i32_le();
5591 *v = val;
5592 }
5593 for v in &mut __struct.ar_f {
5594 let val = buf.get_f32_le();
5595 *v = val;
5596 }
5597 __struct.v2 = buf.get_u16_le();
5598 for v in &mut __struct.ar_u16 {
5599 let val = buf.get_u16_le();
5600 *v = val;
5601 }
5602 for v in &mut __struct.ar_i16 {
5603 let val = buf.get_i16_le();
5604 *v = val;
5605 }
5606 __struct.v1 = buf.get_u8();
5607 for v in &mut __struct.ar_u8 {
5608 let val = buf.get_u8();
5609 *v = val;
5610 }
5611 for v in &mut __struct.ar_i8 {
5612 let val = buf.get_i8();
5613 *v = val;
5614 }
5615 for v in &mut __struct.ar_c {
5616 let val = buf.get_u8();
5617 *v = val;
5618 }
5619 Ok(__struct)
5620 }
5621 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5622 let mut __tmp = BytesMut::new(bytes);
5623 #[allow(clippy::absurd_extreme_comparisons)]
5624 #[allow(unused_comparisons)]
5625 if __tmp.remaining() < Self::ENCODED_LEN {
5626 panic!(
5627 "buffer is too small (need {} bytes, but got {})",
5628 Self::ENCODED_LEN,
5629 __tmp.remaining(),
5630 )
5631 }
5632 for val in &self.ar_d {
5633 __tmp.put_f64_le(*val);
5634 }
5635 __tmp.put_u32_le(self.v3);
5636 for val in &self.ar_u32 {
5637 __tmp.put_u32_le(*val);
5638 }
5639 for val in &self.ar_i32 {
5640 __tmp.put_i32_le(*val);
5641 }
5642 for val in &self.ar_f {
5643 __tmp.put_f32_le(*val);
5644 }
5645 __tmp.put_u16_le(self.v2);
5646 for val in &self.ar_u16 {
5647 __tmp.put_u16_le(*val);
5648 }
5649 for val in &self.ar_i16 {
5650 __tmp.put_i16_le(*val);
5651 }
5652 __tmp.put_u8(self.v1);
5653 for val in &self.ar_u8 {
5654 __tmp.put_u8(*val);
5655 }
5656 for val in &self.ar_i8 {
5657 __tmp.put_i8(*val);
5658 }
5659 for val in &self.ar_c {
5660 __tmp.put_u8(*val);
5661 }
5662 if matches!(version, MavlinkVersion::V2) {
5663 let len = __tmp.len();
5664 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5665 } else {
5666 __tmp.len()
5667 }
5668 }
5669}
5670#[doc = "Array test #7."]
5671#[doc = ""]
5672#[doc = "ID: 17157"]
5673#[derive(Debug, Clone, PartialEq)]
5674#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5675#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5676pub struct ARRAY_TEST_7_DATA {
5677 #[doc = "Value array"]
5678 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5679 pub ar_d: [f64; 2],
5680 #[doc = "Value array"]
5681 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5682 pub ar_f: [f32; 2],
5683 #[doc = "Value array"]
5684 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5685 pub ar_u32: [u32; 2],
5686 #[doc = "Value array"]
5687 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5688 pub ar_i32: [i32; 2],
5689 #[doc = "Value array"]
5690 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5691 pub ar_u16: [u16; 2],
5692 #[doc = "Value array"]
5693 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5694 pub ar_i16: [i16; 2],
5695 #[doc = "Value array"]
5696 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5697 pub ar_u8: [u8; 2],
5698 #[doc = "Value array"]
5699 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5700 pub ar_i8: [i8; 2],
5701 #[doc = "Value array"]
5702 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5703 pub ar_c: [u8; 32],
5704}
5705impl ARRAY_TEST_7_DATA {
5706 pub const ENCODED_LEN: usize = 84usize;
5707 pub const DEFAULT: Self = Self {
5708 ar_d: [0.0_f64; 2usize],
5709 ar_f: [0.0_f32; 2usize],
5710 ar_u32: [0_u32; 2usize],
5711 ar_i32: [0_i32; 2usize],
5712 ar_u16: [0_u16; 2usize],
5713 ar_i16: [0_i16; 2usize],
5714 ar_u8: [0_u8; 2usize],
5715 ar_i8: [0_i8; 2usize],
5716 ar_c: [0_u8; 32usize],
5717 };
5718 #[cfg(feature = "arbitrary")]
5719 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5720 use arbitrary::{Arbitrary, Unstructured};
5721 let mut buf = [0u8; 1024];
5722 rng.fill_bytes(&mut buf);
5723 let mut unstructured = Unstructured::new(&buf);
5724 Self::arbitrary(&mut unstructured).unwrap_or_default()
5725 }
5726}
5727impl Default for ARRAY_TEST_7_DATA {
5728 fn default() -> Self {
5729 Self::DEFAULT.clone()
5730 }
5731}
5732impl MessageData for ARRAY_TEST_7_DATA {
5733 type Message = MavMessage;
5734 const ID: u32 = 17157u32;
5735 const NAME: &'static str = "ARRAY_TEST_7";
5736 const EXTRA_CRC: u8 = 187u8;
5737 const ENCODED_LEN: usize = 84usize;
5738 fn deser(
5739 _version: MavlinkVersion,
5740 __input: &[u8],
5741 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5742 let avail_len = __input.len();
5743 let mut payload_buf = [0; Self::ENCODED_LEN];
5744 let mut buf = if avail_len < Self::ENCODED_LEN {
5745 payload_buf[0..avail_len].copy_from_slice(__input);
5746 Bytes::new(&payload_buf)
5747 } else {
5748 Bytes::new(__input)
5749 };
5750 let mut __struct = Self::default();
5751 for v in &mut __struct.ar_d {
5752 let val = buf.get_f64_le();
5753 *v = val;
5754 }
5755 for v in &mut __struct.ar_f {
5756 let val = buf.get_f32_le();
5757 *v = val;
5758 }
5759 for v in &mut __struct.ar_u32 {
5760 let val = buf.get_u32_le();
5761 *v = val;
5762 }
5763 for v in &mut __struct.ar_i32 {
5764 let val = buf.get_i32_le();
5765 *v = val;
5766 }
5767 for v in &mut __struct.ar_u16 {
5768 let val = buf.get_u16_le();
5769 *v = val;
5770 }
5771 for v in &mut __struct.ar_i16 {
5772 let val = buf.get_i16_le();
5773 *v = val;
5774 }
5775 for v in &mut __struct.ar_u8 {
5776 let val = buf.get_u8();
5777 *v = val;
5778 }
5779 for v in &mut __struct.ar_i8 {
5780 let val = buf.get_i8();
5781 *v = val;
5782 }
5783 for v in &mut __struct.ar_c {
5784 let val = buf.get_u8();
5785 *v = val;
5786 }
5787 Ok(__struct)
5788 }
5789 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5790 let mut __tmp = BytesMut::new(bytes);
5791 #[allow(clippy::absurd_extreme_comparisons)]
5792 #[allow(unused_comparisons)]
5793 if __tmp.remaining() < Self::ENCODED_LEN {
5794 panic!(
5795 "buffer is too small (need {} bytes, but got {})",
5796 Self::ENCODED_LEN,
5797 __tmp.remaining(),
5798 )
5799 }
5800 for val in &self.ar_d {
5801 __tmp.put_f64_le(*val);
5802 }
5803 for val in &self.ar_f {
5804 __tmp.put_f32_le(*val);
5805 }
5806 for val in &self.ar_u32 {
5807 __tmp.put_u32_le(*val);
5808 }
5809 for val in &self.ar_i32 {
5810 __tmp.put_i32_le(*val);
5811 }
5812 for val in &self.ar_u16 {
5813 __tmp.put_u16_le(*val);
5814 }
5815 for val in &self.ar_i16 {
5816 __tmp.put_i16_le(*val);
5817 }
5818 for val in &self.ar_u8 {
5819 __tmp.put_u8(*val);
5820 }
5821 for val in &self.ar_i8 {
5822 __tmp.put_i8(*val);
5823 }
5824 for val in &self.ar_c {
5825 __tmp.put_u8(*val);
5826 }
5827 if matches!(version, MavlinkVersion::V2) {
5828 let len = __tmp.len();
5829 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5830 } else {
5831 __tmp.len()
5832 }
5833 }
5834}
5835#[doc = "Array test #8."]
5836#[doc = ""]
5837#[doc = "ID: 17158"]
5838#[derive(Debug, Clone, PartialEq)]
5839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5841pub struct ARRAY_TEST_8_DATA {
5842 #[doc = "Value array"]
5843 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5844 pub ar_d: [f64; 2],
5845 #[doc = "Stub field"]
5846 pub v3: u32,
5847 #[doc = "Value array"]
5848 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5849 pub ar_u16: [u16; 2],
5850}
5851impl ARRAY_TEST_8_DATA {
5852 pub const ENCODED_LEN: usize = 24usize;
5853 pub const DEFAULT: Self = Self {
5854 ar_d: [0.0_f64; 2usize],
5855 v3: 0_u32,
5856 ar_u16: [0_u16; 2usize],
5857 };
5858 #[cfg(feature = "arbitrary")]
5859 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5860 use arbitrary::{Arbitrary, Unstructured};
5861 let mut buf = [0u8; 1024];
5862 rng.fill_bytes(&mut buf);
5863 let mut unstructured = Unstructured::new(&buf);
5864 Self::arbitrary(&mut unstructured).unwrap_or_default()
5865 }
5866}
5867impl Default for ARRAY_TEST_8_DATA {
5868 fn default() -> Self {
5869 Self::DEFAULT.clone()
5870 }
5871}
5872impl MessageData for ARRAY_TEST_8_DATA {
5873 type Message = MavMessage;
5874 const ID: u32 = 17158u32;
5875 const NAME: &'static str = "ARRAY_TEST_8";
5876 const EXTRA_CRC: u8 = 106u8;
5877 const ENCODED_LEN: usize = 24usize;
5878 fn deser(
5879 _version: MavlinkVersion,
5880 __input: &[u8],
5881 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5882 let avail_len = __input.len();
5883 let mut payload_buf = [0; Self::ENCODED_LEN];
5884 let mut buf = if avail_len < Self::ENCODED_LEN {
5885 payload_buf[0..avail_len].copy_from_slice(__input);
5886 Bytes::new(&payload_buf)
5887 } else {
5888 Bytes::new(__input)
5889 };
5890 let mut __struct = Self::default();
5891 for v in &mut __struct.ar_d {
5892 let val = buf.get_f64_le();
5893 *v = val;
5894 }
5895 __struct.v3 = buf.get_u32_le();
5896 for v in &mut __struct.ar_u16 {
5897 let val = buf.get_u16_le();
5898 *v = val;
5899 }
5900 Ok(__struct)
5901 }
5902 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5903 let mut __tmp = BytesMut::new(bytes);
5904 #[allow(clippy::absurd_extreme_comparisons)]
5905 #[allow(unused_comparisons)]
5906 if __tmp.remaining() < Self::ENCODED_LEN {
5907 panic!(
5908 "buffer is too small (need {} bytes, but got {})",
5909 Self::ENCODED_LEN,
5910 __tmp.remaining(),
5911 )
5912 }
5913 for val in &self.ar_d {
5914 __tmp.put_f64_le(*val);
5915 }
5916 __tmp.put_u32_le(self.v3);
5917 for val in &self.ar_u16 {
5918 __tmp.put_u16_le(*val);
5919 }
5920 if matches!(version, MavlinkVersion::V2) {
5921 let len = __tmp.len();
5922 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5923 } else {
5924 __tmp.len()
5925 }
5926 }
5927}
5928#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5929#[doc = ""]
5930#[doc = "ID: 30"]
5931#[derive(Debug, Clone, PartialEq)]
5932#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5933#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5934pub struct ATTITUDE_DATA {
5935 #[doc = "Timestamp (time since system boot)."]
5936 pub time_boot_ms: u32,
5937 #[doc = "Roll angle (-pi..+pi)"]
5938 pub roll: f32,
5939 #[doc = "Pitch angle (-pi..+pi)"]
5940 pub pitch: f32,
5941 #[doc = "Yaw angle (-pi..+pi)"]
5942 pub yaw: f32,
5943 #[doc = "Roll angular speed"]
5944 pub rollspeed: f32,
5945 #[doc = "Pitch angular speed"]
5946 pub pitchspeed: f32,
5947 #[doc = "Yaw angular speed"]
5948 pub yawspeed: f32,
5949}
5950impl ATTITUDE_DATA {
5951 pub const ENCODED_LEN: usize = 28usize;
5952 pub const DEFAULT: Self = Self {
5953 time_boot_ms: 0_u32,
5954 roll: 0.0_f32,
5955 pitch: 0.0_f32,
5956 yaw: 0.0_f32,
5957 rollspeed: 0.0_f32,
5958 pitchspeed: 0.0_f32,
5959 yawspeed: 0.0_f32,
5960 };
5961 #[cfg(feature = "arbitrary")]
5962 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5963 use arbitrary::{Arbitrary, Unstructured};
5964 let mut buf = [0u8; 1024];
5965 rng.fill_bytes(&mut buf);
5966 let mut unstructured = Unstructured::new(&buf);
5967 Self::arbitrary(&mut unstructured).unwrap_or_default()
5968 }
5969}
5970impl Default for ATTITUDE_DATA {
5971 fn default() -> Self {
5972 Self::DEFAULT.clone()
5973 }
5974}
5975impl MessageData for ATTITUDE_DATA {
5976 type Message = MavMessage;
5977 const ID: u32 = 30u32;
5978 const NAME: &'static str = "ATTITUDE";
5979 const EXTRA_CRC: u8 = 39u8;
5980 const ENCODED_LEN: usize = 28usize;
5981 fn deser(
5982 _version: MavlinkVersion,
5983 __input: &[u8],
5984 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5985 let avail_len = __input.len();
5986 let mut payload_buf = [0; Self::ENCODED_LEN];
5987 let mut buf = if avail_len < Self::ENCODED_LEN {
5988 payload_buf[0..avail_len].copy_from_slice(__input);
5989 Bytes::new(&payload_buf)
5990 } else {
5991 Bytes::new(__input)
5992 };
5993 let mut __struct = Self::default();
5994 __struct.time_boot_ms = buf.get_u32_le();
5995 __struct.roll = buf.get_f32_le();
5996 __struct.pitch = buf.get_f32_le();
5997 __struct.yaw = buf.get_f32_le();
5998 __struct.rollspeed = buf.get_f32_le();
5999 __struct.pitchspeed = buf.get_f32_le();
6000 __struct.yawspeed = buf.get_f32_le();
6001 Ok(__struct)
6002 }
6003 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6004 let mut __tmp = BytesMut::new(bytes);
6005 #[allow(clippy::absurd_extreme_comparisons)]
6006 #[allow(unused_comparisons)]
6007 if __tmp.remaining() < Self::ENCODED_LEN {
6008 panic!(
6009 "buffer is too small (need {} bytes, but got {})",
6010 Self::ENCODED_LEN,
6011 __tmp.remaining(),
6012 )
6013 }
6014 __tmp.put_u32_le(self.time_boot_ms);
6015 __tmp.put_f32_le(self.roll);
6016 __tmp.put_f32_le(self.pitch);
6017 __tmp.put_f32_le(self.yaw);
6018 __tmp.put_f32_le(self.rollspeed);
6019 __tmp.put_f32_le(self.pitchspeed);
6020 __tmp.put_f32_le(self.yawspeed);
6021 if matches!(version, MavlinkVersion::V2) {
6022 let len = __tmp.len();
6023 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6024 } else {
6025 __tmp.len()
6026 }
6027 }
6028}
6029#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
6030#[doc = ""]
6031#[doc = "ID: 31"]
6032#[derive(Debug, Clone, PartialEq)]
6033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6035pub struct ATTITUDE_QUATERNION_DATA {
6036 #[doc = "Timestamp (time since system boot)."]
6037 pub time_boot_ms: u32,
6038 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
6039 pub q1: f32,
6040 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
6041 pub q2: f32,
6042 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
6043 pub q3: f32,
6044 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
6045 pub q4: f32,
6046 #[doc = "Roll angular speed"]
6047 pub rollspeed: f32,
6048 #[doc = "Pitch angular speed"]
6049 pub pitchspeed: f32,
6050 #[doc = "Yaw angular speed"]
6051 pub yawspeed: f32,
6052 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
6053 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6055 pub repr_offset_q: [f32; 4],
6056}
6057impl ATTITUDE_QUATERNION_DATA {
6058 pub const ENCODED_LEN: usize = 48usize;
6059 pub const DEFAULT: Self = Self {
6060 time_boot_ms: 0_u32,
6061 q1: 0.0_f32,
6062 q2: 0.0_f32,
6063 q3: 0.0_f32,
6064 q4: 0.0_f32,
6065 rollspeed: 0.0_f32,
6066 pitchspeed: 0.0_f32,
6067 yawspeed: 0.0_f32,
6068 repr_offset_q: [0.0_f32; 4usize],
6069 };
6070 #[cfg(feature = "arbitrary")]
6071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6072 use arbitrary::{Arbitrary, Unstructured};
6073 let mut buf = [0u8; 1024];
6074 rng.fill_bytes(&mut buf);
6075 let mut unstructured = Unstructured::new(&buf);
6076 Self::arbitrary(&mut unstructured).unwrap_or_default()
6077 }
6078}
6079impl Default for ATTITUDE_QUATERNION_DATA {
6080 fn default() -> Self {
6081 Self::DEFAULT.clone()
6082 }
6083}
6084impl MessageData for ATTITUDE_QUATERNION_DATA {
6085 type Message = MavMessage;
6086 const ID: u32 = 31u32;
6087 const NAME: &'static str = "ATTITUDE_QUATERNION";
6088 const EXTRA_CRC: u8 = 246u8;
6089 const ENCODED_LEN: usize = 48usize;
6090 fn deser(
6091 _version: MavlinkVersion,
6092 __input: &[u8],
6093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6094 let avail_len = __input.len();
6095 let mut payload_buf = [0; Self::ENCODED_LEN];
6096 let mut buf = if avail_len < Self::ENCODED_LEN {
6097 payload_buf[0..avail_len].copy_from_slice(__input);
6098 Bytes::new(&payload_buf)
6099 } else {
6100 Bytes::new(__input)
6101 };
6102 let mut __struct = Self::default();
6103 __struct.time_boot_ms = buf.get_u32_le();
6104 __struct.q1 = buf.get_f32_le();
6105 __struct.q2 = buf.get_f32_le();
6106 __struct.q3 = buf.get_f32_le();
6107 __struct.q4 = buf.get_f32_le();
6108 __struct.rollspeed = buf.get_f32_le();
6109 __struct.pitchspeed = buf.get_f32_le();
6110 __struct.yawspeed = buf.get_f32_le();
6111 for v in &mut __struct.repr_offset_q {
6112 let val = buf.get_f32_le();
6113 *v = val;
6114 }
6115 Ok(__struct)
6116 }
6117 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6118 let mut __tmp = BytesMut::new(bytes);
6119 #[allow(clippy::absurd_extreme_comparisons)]
6120 #[allow(unused_comparisons)]
6121 if __tmp.remaining() < Self::ENCODED_LEN {
6122 panic!(
6123 "buffer is too small (need {} bytes, but got {})",
6124 Self::ENCODED_LEN,
6125 __tmp.remaining(),
6126 )
6127 }
6128 __tmp.put_u32_le(self.time_boot_ms);
6129 __tmp.put_f32_le(self.q1);
6130 __tmp.put_f32_le(self.q2);
6131 __tmp.put_f32_le(self.q3);
6132 __tmp.put_f32_le(self.q4);
6133 __tmp.put_f32_le(self.rollspeed);
6134 __tmp.put_f32_le(self.pitchspeed);
6135 __tmp.put_f32_le(self.yawspeed);
6136 if matches!(version, MavlinkVersion::V2) {
6137 for val in &self.repr_offset_q {
6138 __tmp.put_f32_le(*val);
6139 }
6140 let len = __tmp.len();
6141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6142 } else {
6143 __tmp.len()
6144 }
6145 }
6146}
6147#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
6148#[doc = ""]
6149#[doc = "ID: 61"]
6150#[derive(Debug, Clone, PartialEq)]
6151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6152#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6153pub struct ATTITUDE_QUATERNION_COV_DATA {
6154 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6155 pub time_usec: u64,
6156 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
6157 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6158 pub q: [f32; 4],
6159 #[doc = "Roll angular speed"]
6160 pub rollspeed: f32,
6161 #[doc = "Pitch angular speed"]
6162 pub pitchspeed: f32,
6163 #[doc = "Yaw angular speed"]
6164 pub yawspeed: f32,
6165 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
6166 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6167 pub covariance: [f32; 9],
6168}
6169impl ATTITUDE_QUATERNION_COV_DATA {
6170 pub const ENCODED_LEN: usize = 72usize;
6171 pub const DEFAULT: Self = Self {
6172 time_usec: 0_u64,
6173 q: [0.0_f32; 4usize],
6174 rollspeed: 0.0_f32,
6175 pitchspeed: 0.0_f32,
6176 yawspeed: 0.0_f32,
6177 covariance: [0.0_f32; 9usize],
6178 };
6179 #[cfg(feature = "arbitrary")]
6180 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6181 use arbitrary::{Arbitrary, Unstructured};
6182 let mut buf = [0u8; 1024];
6183 rng.fill_bytes(&mut buf);
6184 let mut unstructured = Unstructured::new(&buf);
6185 Self::arbitrary(&mut unstructured).unwrap_or_default()
6186 }
6187}
6188impl Default for ATTITUDE_QUATERNION_COV_DATA {
6189 fn default() -> Self {
6190 Self::DEFAULT.clone()
6191 }
6192}
6193impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
6194 type Message = MavMessage;
6195 const ID: u32 = 61u32;
6196 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
6197 const EXTRA_CRC: u8 = 167u8;
6198 const ENCODED_LEN: usize = 72usize;
6199 fn deser(
6200 _version: MavlinkVersion,
6201 __input: &[u8],
6202 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6203 let avail_len = __input.len();
6204 let mut payload_buf = [0; Self::ENCODED_LEN];
6205 let mut buf = if avail_len < Self::ENCODED_LEN {
6206 payload_buf[0..avail_len].copy_from_slice(__input);
6207 Bytes::new(&payload_buf)
6208 } else {
6209 Bytes::new(__input)
6210 };
6211 let mut __struct = Self::default();
6212 __struct.time_usec = buf.get_u64_le();
6213 for v in &mut __struct.q {
6214 let val = buf.get_f32_le();
6215 *v = val;
6216 }
6217 __struct.rollspeed = buf.get_f32_le();
6218 __struct.pitchspeed = buf.get_f32_le();
6219 __struct.yawspeed = buf.get_f32_le();
6220 for v in &mut __struct.covariance {
6221 let val = buf.get_f32_le();
6222 *v = val;
6223 }
6224 Ok(__struct)
6225 }
6226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6227 let mut __tmp = BytesMut::new(bytes);
6228 #[allow(clippy::absurd_extreme_comparisons)]
6229 #[allow(unused_comparisons)]
6230 if __tmp.remaining() < Self::ENCODED_LEN {
6231 panic!(
6232 "buffer is too small (need {} bytes, but got {})",
6233 Self::ENCODED_LEN,
6234 __tmp.remaining(),
6235 )
6236 }
6237 __tmp.put_u64_le(self.time_usec);
6238 for val in &self.q {
6239 __tmp.put_f32_le(*val);
6240 }
6241 __tmp.put_f32_le(self.rollspeed);
6242 __tmp.put_f32_le(self.pitchspeed);
6243 __tmp.put_f32_le(self.yawspeed);
6244 for val in &self.covariance {
6245 __tmp.put_f32_le(*val);
6246 }
6247 if matches!(version, MavlinkVersion::V2) {
6248 let len = __tmp.len();
6249 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6250 } else {
6251 __tmp.len()
6252 }
6253 }
6254}
6255#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
6256#[doc = ""]
6257#[doc = "ID: 83"]
6258#[derive(Debug, Clone, PartialEq)]
6259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6261pub struct ATTITUDE_TARGET_DATA {
6262 #[doc = "Timestamp (time since system boot)."]
6263 pub time_boot_ms: u32,
6264 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6265 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6266 pub q: [f32; 4],
6267 #[doc = "Body roll rate"]
6268 pub body_roll_rate: f32,
6269 #[doc = "Body pitch rate"]
6270 pub body_pitch_rate: f32,
6271 #[doc = "Body yaw rate"]
6272 pub body_yaw_rate: f32,
6273 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
6274 pub thrust: f32,
6275 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
6276 pub type_mask: AttitudeTargetTypemask,
6277}
6278impl ATTITUDE_TARGET_DATA {
6279 pub const ENCODED_LEN: usize = 37usize;
6280 pub const DEFAULT: Self = Self {
6281 time_boot_ms: 0_u32,
6282 q: [0.0_f32; 4usize],
6283 body_roll_rate: 0.0_f32,
6284 body_pitch_rate: 0.0_f32,
6285 body_yaw_rate: 0.0_f32,
6286 thrust: 0.0_f32,
6287 type_mask: AttitudeTargetTypemask::DEFAULT,
6288 };
6289 #[cfg(feature = "arbitrary")]
6290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6291 use arbitrary::{Arbitrary, Unstructured};
6292 let mut buf = [0u8; 1024];
6293 rng.fill_bytes(&mut buf);
6294 let mut unstructured = Unstructured::new(&buf);
6295 Self::arbitrary(&mut unstructured).unwrap_or_default()
6296 }
6297}
6298impl Default for ATTITUDE_TARGET_DATA {
6299 fn default() -> Self {
6300 Self::DEFAULT.clone()
6301 }
6302}
6303impl MessageData for ATTITUDE_TARGET_DATA {
6304 type Message = MavMessage;
6305 const ID: u32 = 83u32;
6306 const NAME: &'static str = "ATTITUDE_TARGET";
6307 const EXTRA_CRC: u8 = 22u8;
6308 const ENCODED_LEN: usize = 37usize;
6309 fn deser(
6310 _version: MavlinkVersion,
6311 __input: &[u8],
6312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6313 let avail_len = __input.len();
6314 let mut payload_buf = [0; Self::ENCODED_LEN];
6315 let mut buf = if avail_len < Self::ENCODED_LEN {
6316 payload_buf[0..avail_len].copy_from_slice(__input);
6317 Bytes::new(&payload_buf)
6318 } else {
6319 Bytes::new(__input)
6320 };
6321 let mut __struct = Self::default();
6322 __struct.time_boot_ms = buf.get_u32_le();
6323 for v in &mut __struct.q {
6324 let val = buf.get_f32_le();
6325 *v = val;
6326 }
6327 __struct.body_roll_rate = buf.get_f32_le();
6328 __struct.body_pitch_rate = buf.get_f32_le();
6329 __struct.body_yaw_rate = buf.get_f32_le();
6330 __struct.thrust = buf.get_f32_le();
6331 let tmp = buf.get_u8();
6332 __struct.type_mask = AttitudeTargetTypemask::from_bits(
6333 tmp & AttitudeTargetTypemask::all().bits(),
6334 )
6335 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6336 flag_type: "AttitudeTargetTypemask",
6337 value: tmp as u32,
6338 })?;
6339 Ok(__struct)
6340 }
6341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6342 let mut __tmp = BytesMut::new(bytes);
6343 #[allow(clippy::absurd_extreme_comparisons)]
6344 #[allow(unused_comparisons)]
6345 if __tmp.remaining() < Self::ENCODED_LEN {
6346 panic!(
6347 "buffer is too small (need {} bytes, but got {})",
6348 Self::ENCODED_LEN,
6349 __tmp.remaining(),
6350 )
6351 }
6352 __tmp.put_u32_le(self.time_boot_ms);
6353 for val in &self.q {
6354 __tmp.put_f32_le(*val);
6355 }
6356 __tmp.put_f32_le(self.body_roll_rate);
6357 __tmp.put_f32_le(self.body_pitch_rate);
6358 __tmp.put_f32_le(self.body_yaw_rate);
6359 __tmp.put_f32_le(self.thrust);
6360 __tmp.put_u8(self.type_mask.bits());
6361 if matches!(version, MavlinkVersion::V2) {
6362 let len = __tmp.len();
6363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6364 } else {
6365 __tmp.len()
6366 }
6367 }
6368}
6369#[doc = "Motion capture attitude and position."]
6370#[doc = ""]
6371#[doc = "ID: 138"]
6372#[derive(Debug, Clone, PartialEq)]
6373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6375pub struct ATT_POS_MOCAP_DATA {
6376 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6377 pub time_usec: u64,
6378 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6379 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6380 pub q: [f32; 4],
6381 #[doc = "X position (NED)"]
6382 pub x: f32,
6383 #[doc = "Y position (NED)"]
6384 pub y: f32,
6385 #[doc = "Z position (NED)"]
6386 pub z: f32,
6387 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
6388 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6389 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6390 pub covariance: [f32; 21],
6391}
6392impl ATT_POS_MOCAP_DATA {
6393 pub const ENCODED_LEN: usize = 120usize;
6394 pub const DEFAULT: Self = Self {
6395 time_usec: 0_u64,
6396 q: [0.0_f32; 4usize],
6397 x: 0.0_f32,
6398 y: 0.0_f32,
6399 z: 0.0_f32,
6400 covariance: [0.0_f32; 21usize],
6401 };
6402 #[cfg(feature = "arbitrary")]
6403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6404 use arbitrary::{Arbitrary, Unstructured};
6405 let mut buf = [0u8; 1024];
6406 rng.fill_bytes(&mut buf);
6407 let mut unstructured = Unstructured::new(&buf);
6408 Self::arbitrary(&mut unstructured).unwrap_or_default()
6409 }
6410}
6411impl Default for ATT_POS_MOCAP_DATA {
6412 fn default() -> Self {
6413 Self::DEFAULT.clone()
6414 }
6415}
6416impl MessageData for ATT_POS_MOCAP_DATA {
6417 type Message = MavMessage;
6418 const ID: u32 = 138u32;
6419 const NAME: &'static str = "ATT_POS_MOCAP";
6420 const EXTRA_CRC: u8 = 109u8;
6421 const ENCODED_LEN: usize = 120usize;
6422 fn deser(
6423 _version: MavlinkVersion,
6424 __input: &[u8],
6425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6426 let avail_len = __input.len();
6427 let mut payload_buf = [0; Self::ENCODED_LEN];
6428 let mut buf = if avail_len < Self::ENCODED_LEN {
6429 payload_buf[0..avail_len].copy_from_slice(__input);
6430 Bytes::new(&payload_buf)
6431 } else {
6432 Bytes::new(__input)
6433 };
6434 let mut __struct = Self::default();
6435 __struct.time_usec = buf.get_u64_le();
6436 for v in &mut __struct.q {
6437 let val = buf.get_f32_le();
6438 *v = val;
6439 }
6440 __struct.x = buf.get_f32_le();
6441 __struct.y = buf.get_f32_le();
6442 __struct.z = buf.get_f32_le();
6443 for v in &mut __struct.covariance {
6444 let val = buf.get_f32_le();
6445 *v = val;
6446 }
6447 Ok(__struct)
6448 }
6449 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6450 let mut __tmp = BytesMut::new(bytes);
6451 #[allow(clippy::absurd_extreme_comparisons)]
6452 #[allow(unused_comparisons)]
6453 if __tmp.remaining() < Self::ENCODED_LEN {
6454 panic!(
6455 "buffer is too small (need {} bytes, but got {})",
6456 Self::ENCODED_LEN,
6457 __tmp.remaining(),
6458 )
6459 }
6460 __tmp.put_u64_le(self.time_usec);
6461 for val in &self.q {
6462 __tmp.put_f32_le(*val);
6463 }
6464 __tmp.put_f32_le(self.x);
6465 __tmp.put_f32_le(self.y);
6466 __tmp.put_f32_le(self.z);
6467 if matches!(version, MavlinkVersion::V2) {
6468 for val in &self.covariance {
6469 __tmp.put_f32_le(*val);
6470 }
6471 let len = __tmp.len();
6472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6473 } else {
6474 __tmp.len()
6475 }
6476 }
6477}
6478#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
6479#[doc = ""]
6480#[doc = "ID: 7"]
6481#[derive(Debug, Clone, PartialEq)]
6482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6484pub struct AUTH_KEY_DATA {
6485 #[doc = "key"]
6486 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6487 pub key: [u8; 32],
6488}
6489impl AUTH_KEY_DATA {
6490 pub const ENCODED_LEN: usize = 32usize;
6491 pub const DEFAULT: Self = Self {
6492 key: [0_u8; 32usize],
6493 };
6494 #[cfg(feature = "arbitrary")]
6495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6496 use arbitrary::{Arbitrary, Unstructured};
6497 let mut buf = [0u8; 1024];
6498 rng.fill_bytes(&mut buf);
6499 let mut unstructured = Unstructured::new(&buf);
6500 Self::arbitrary(&mut unstructured).unwrap_or_default()
6501 }
6502}
6503impl Default for AUTH_KEY_DATA {
6504 fn default() -> Self {
6505 Self::DEFAULT.clone()
6506 }
6507}
6508impl MessageData for AUTH_KEY_DATA {
6509 type Message = MavMessage;
6510 const ID: u32 = 7u32;
6511 const NAME: &'static str = "AUTH_KEY";
6512 const EXTRA_CRC: u8 = 119u8;
6513 const ENCODED_LEN: usize = 32usize;
6514 fn deser(
6515 _version: MavlinkVersion,
6516 __input: &[u8],
6517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6518 let avail_len = __input.len();
6519 let mut payload_buf = [0; Self::ENCODED_LEN];
6520 let mut buf = if avail_len < Self::ENCODED_LEN {
6521 payload_buf[0..avail_len].copy_from_slice(__input);
6522 Bytes::new(&payload_buf)
6523 } else {
6524 Bytes::new(__input)
6525 };
6526 let mut __struct = Self::default();
6527 for v in &mut __struct.key {
6528 let val = buf.get_u8();
6529 *v = val;
6530 }
6531 Ok(__struct)
6532 }
6533 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6534 let mut __tmp = BytesMut::new(bytes);
6535 #[allow(clippy::absurd_extreme_comparisons)]
6536 #[allow(unused_comparisons)]
6537 if __tmp.remaining() < Self::ENCODED_LEN {
6538 panic!(
6539 "buffer is too small (need {} bytes, but got {})",
6540 Self::ENCODED_LEN,
6541 __tmp.remaining(),
6542 )
6543 }
6544 for val in &self.key {
6545 __tmp.put_u8(*val);
6546 }
6547 if matches!(version, MavlinkVersion::V2) {
6548 let len = __tmp.len();
6549 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6550 } else {
6551 __tmp.len()
6552 }
6553 }
6554}
6555#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6556#[doc = ""]
6557#[doc = "ID: 286"]
6558#[derive(Debug, Clone, PartialEq)]
6559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6561pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6562 #[doc = "Timestamp (time since system boot)."]
6563 pub time_boot_us: u64,
6564 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6565 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6566 pub q: [f32; 4],
6567 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6568 pub q_estimated_delay_us: u32,
6569 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6570 pub vx: f32,
6571 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6572 pub vy: f32,
6573 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6574 pub vz: f32,
6575 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6576 pub v_estimated_delay_us: u32,
6577 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6578 pub feed_forward_angular_velocity_z: f32,
6579 #[doc = "Bitmap indicating which estimator outputs are valid."]
6580 pub estimator_status: EstimatorStatusFlags,
6581 #[doc = "System ID"]
6582 pub target_system: u8,
6583 #[doc = "Component ID"]
6584 pub target_component: u8,
6585 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6586 pub landed_state: MavLandedState,
6587 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6588 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6589 pub angular_velocity_z: f32,
6590}
6591impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6592 pub const ENCODED_LEN: usize = 57usize;
6593 pub const DEFAULT: Self = Self {
6594 time_boot_us: 0_u64,
6595 q: [0.0_f32; 4usize],
6596 q_estimated_delay_us: 0_u32,
6597 vx: 0.0_f32,
6598 vy: 0.0_f32,
6599 vz: 0.0_f32,
6600 v_estimated_delay_us: 0_u32,
6601 feed_forward_angular_velocity_z: 0.0_f32,
6602 estimator_status: EstimatorStatusFlags::DEFAULT,
6603 target_system: 0_u8,
6604 target_component: 0_u8,
6605 landed_state: MavLandedState::DEFAULT,
6606 angular_velocity_z: 0.0_f32,
6607 };
6608 #[cfg(feature = "arbitrary")]
6609 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6610 use arbitrary::{Arbitrary, Unstructured};
6611 let mut buf = [0u8; 1024];
6612 rng.fill_bytes(&mut buf);
6613 let mut unstructured = Unstructured::new(&buf);
6614 Self::arbitrary(&mut unstructured).unwrap_or_default()
6615 }
6616}
6617impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6618 fn default() -> Self {
6619 Self::DEFAULT.clone()
6620 }
6621}
6622impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6623 type Message = MavMessage;
6624 const ID: u32 = 286u32;
6625 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6626 const EXTRA_CRC: u8 = 210u8;
6627 const ENCODED_LEN: usize = 57usize;
6628 fn deser(
6629 _version: MavlinkVersion,
6630 __input: &[u8],
6631 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6632 let avail_len = __input.len();
6633 let mut payload_buf = [0; Self::ENCODED_LEN];
6634 let mut buf = if avail_len < Self::ENCODED_LEN {
6635 payload_buf[0..avail_len].copy_from_slice(__input);
6636 Bytes::new(&payload_buf)
6637 } else {
6638 Bytes::new(__input)
6639 };
6640 let mut __struct = Self::default();
6641 __struct.time_boot_us = buf.get_u64_le();
6642 for v in &mut __struct.q {
6643 let val = buf.get_f32_le();
6644 *v = val;
6645 }
6646 __struct.q_estimated_delay_us = buf.get_u32_le();
6647 __struct.vx = buf.get_f32_le();
6648 __struct.vy = buf.get_f32_le();
6649 __struct.vz = buf.get_f32_le();
6650 __struct.v_estimated_delay_us = buf.get_u32_le();
6651 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6652 let tmp = buf.get_u16_le();
6653 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6654 tmp & EstimatorStatusFlags::all().bits(),
6655 )
6656 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6657 flag_type: "EstimatorStatusFlags",
6658 value: tmp as u32,
6659 })?;
6660 __struct.target_system = buf.get_u8();
6661 __struct.target_component = buf.get_u8();
6662 let tmp = buf.get_u8();
6663 __struct.landed_state =
6664 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6665 enum_type: "MavLandedState",
6666 value: tmp as u32,
6667 })?;
6668 __struct.angular_velocity_z = buf.get_f32_le();
6669 Ok(__struct)
6670 }
6671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6672 let mut __tmp = BytesMut::new(bytes);
6673 #[allow(clippy::absurd_extreme_comparisons)]
6674 #[allow(unused_comparisons)]
6675 if __tmp.remaining() < Self::ENCODED_LEN {
6676 panic!(
6677 "buffer is too small (need {} bytes, but got {})",
6678 Self::ENCODED_LEN,
6679 __tmp.remaining(),
6680 )
6681 }
6682 __tmp.put_u64_le(self.time_boot_us);
6683 for val in &self.q {
6684 __tmp.put_f32_le(*val);
6685 }
6686 __tmp.put_u32_le(self.q_estimated_delay_us);
6687 __tmp.put_f32_le(self.vx);
6688 __tmp.put_f32_le(self.vy);
6689 __tmp.put_f32_le(self.vz);
6690 __tmp.put_u32_le(self.v_estimated_delay_us);
6691 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6692 __tmp.put_u16_le(self.estimator_status.bits());
6693 __tmp.put_u8(self.target_system);
6694 __tmp.put_u8(self.target_component);
6695 __tmp.put_u8(self.landed_state as u8);
6696 if matches!(version, MavlinkVersion::V2) {
6697 __tmp.put_f32_le(self.angular_velocity_z);
6698 let len = __tmp.len();
6699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6700 } else {
6701 __tmp.len()
6702 }
6703 }
6704}
6705#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6706#[doc = ""]
6707#[doc = "ID: 148"]
6708#[derive(Debug, Clone, PartialEq)]
6709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6711pub struct AUTOPILOT_VERSION_DATA {
6712 #[doc = "Bitmap of capabilities"]
6713 pub capabilities: MavProtocolCapability,
6714 #[doc = "UID if provided by hardware (see uid2)"]
6715 pub uid: u64,
6716 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6717 pub flight_sw_version: u32,
6718 #[doc = "Middleware version number"]
6719 pub middleware_sw_version: u32,
6720 #[doc = "Operating system version number"]
6721 pub os_sw_version: u32,
6722 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6723 pub board_version: u32,
6724 #[doc = "ID of the board vendor"]
6725 pub vendor_id: u16,
6726 #[doc = "ID of the product"]
6727 pub product_id: u16,
6728 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6729 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6730 pub flight_custom_version: [u8; 8],
6731 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6732 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6733 pub middleware_custom_version: [u8; 8],
6734 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6735 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6736 pub os_custom_version: [u8; 8],
6737 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6738 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6739 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6740 pub uid2: [u8; 18],
6741}
6742impl AUTOPILOT_VERSION_DATA {
6743 pub const ENCODED_LEN: usize = 78usize;
6744 pub const DEFAULT: Self = Self {
6745 capabilities: MavProtocolCapability::DEFAULT,
6746 uid: 0_u64,
6747 flight_sw_version: 0_u32,
6748 middleware_sw_version: 0_u32,
6749 os_sw_version: 0_u32,
6750 board_version: 0_u32,
6751 vendor_id: 0_u16,
6752 product_id: 0_u16,
6753 flight_custom_version: [0_u8; 8usize],
6754 middleware_custom_version: [0_u8; 8usize],
6755 os_custom_version: [0_u8; 8usize],
6756 uid2: [0_u8; 18usize],
6757 };
6758 #[cfg(feature = "arbitrary")]
6759 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6760 use arbitrary::{Arbitrary, Unstructured};
6761 let mut buf = [0u8; 1024];
6762 rng.fill_bytes(&mut buf);
6763 let mut unstructured = Unstructured::new(&buf);
6764 Self::arbitrary(&mut unstructured).unwrap_or_default()
6765 }
6766}
6767impl Default for AUTOPILOT_VERSION_DATA {
6768 fn default() -> Self {
6769 Self::DEFAULT.clone()
6770 }
6771}
6772impl MessageData for AUTOPILOT_VERSION_DATA {
6773 type Message = MavMessage;
6774 const ID: u32 = 148u32;
6775 const NAME: &'static str = "AUTOPILOT_VERSION";
6776 const EXTRA_CRC: u8 = 178u8;
6777 const ENCODED_LEN: usize = 78usize;
6778 fn deser(
6779 _version: MavlinkVersion,
6780 __input: &[u8],
6781 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6782 let avail_len = __input.len();
6783 let mut payload_buf = [0; Self::ENCODED_LEN];
6784 let mut buf = if avail_len < Self::ENCODED_LEN {
6785 payload_buf[0..avail_len].copy_from_slice(__input);
6786 Bytes::new(&payload_buf)
6787 } else {
6788 Bytes::new(__input)
6789 };
6790 let mut __struct = Self::default();
6791 let tmp = buf.get_u64_le();
6792 __struct.capabilities = MavProtocolCapability::from_bits(
6793 tmp & MavProtocolCapability::all().bits(),
6794 )
6795 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6796 flag_type: "MavProtocolCapability",
6797 value: tmp as u32,
6798 })?;
6799 __struct.uid = buf.get_u64_le();
6800 __struct.flight_sw_version = buf.get_u32_le();
6801 __struct.middleware_sw_version = buf.get_u32_le();
6802 __struct.os_sw_version = buf.get_u32_le();
6803 __struct.board_version = buf.get_u32_le();
6804 __struct.vendor_id = buf.get_u16_le();
6805 __struct.product_id = buf.get_u16_le();
6806 for v in &mut __struct.flight_custom_version {
6807 let val = buf.get_u8();
6808 *v = val;
6809 }
6810 for v in &mut __struct.middleware_custom_version {
6811 let val = buf.get_u8();
6812 *v = val;
6813 }
6814 for v in &mut __struct.os_custom_version {
6815 let val = buf.get_u8();
6816 *v = val;
6817 }
6818 for v in &mut __struct.uid2 {
6819 let val = buf.get_u8();
6820 *v = val;
6821 }
6822 Ok(__struct)
6823 }
6824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6825 let mut __tmp = BytesMut::new(bytes);
6826 #[allow(clippy::absurd_extreme_comparisons)]
6827 #[allow(unused_comparisons)]
6828 if __tmp.remaining() < Self::ENCODED_LEN {
6829 panic!(
6830 "buffer is too small (need {} bytes, but got {})",
6831 Self::ENCODED_LEN,
6832 __tmp.remaining(),
6833 )
6834 }
6835 __tmp.put_u64_le(self.capabilities.bits());
6836 __tmp.put_u64_le(self.uid);
6837 __tmp.put_u32_le(self.flight_sw_version);
6838 __tmp.put_u32_le(self.middleware_sw_version);
6839 __tmp.put_u32_le(self.os_sw_version);
6840 __tmp.put_u32_le(self.board_version);
6841 __tmp.put_u16_le(self.vendor_id);
6842 __tmp.put_u16_le(self.product_id);
6843 for val in &self.flight_custom_version {
6844 __tmp.put_u8(*val);
6845 }
6846 for val in &self.middleware_custom_version {
6847 __tmp.put_u8(*val);
6848 }
6849 for val in &self.os_custom_version {
6850 __tmp.put_u8(*val);
6851 }
6852 if matches!(version, MavlinkVersion::V2) {
6853 for val in &self.uid2 {
6854 __tmp.put_u8(*val);
6855 }
6856 let len = __tmp.len();
6857 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6858 } else {
6859 __tmp.len()
6860 }
6861 }
6862}
6863#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6864#[doc = ""]
6865#[doc = "ID: 435"]
6866#[derive(Debug, Clone, PartialEq)]
6867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6869pub struct AVAILABLE_MODES_DATA {
6870 #[doc = "A bitfield for use for autopilot-specific flags"]
6871 pub custom_mode: u32,
6872 #[doc = "Mode properties."]
6873 pub properties: MavModeProperty,
6874 #[doc = "The total number of available modes for the current vehicle type."]
6875 pub number_modes: u8,
6876 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6877 pub mode_index: u8,
6878 #[doc = "Standard mode."]
6879 pub standard_mode: MavStandardMode,
6880 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6881 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6882 pub mode_name: [u8; 35],
6883}
6884impl AVAILABLE_MODES_DATA {
6885 pub const ENCODED_LEN: usize = 46usize;
6886 pub const DEFAULT: Self = Self {
6887 custom_mode: 0_u32,
6888 properties: MavModeProperty::DEFAULT,
6889 number_modes: 0_u8,
6890 mode_index: 0_u8,
6891 standard_mode: MavStandardMode::DEFAULT,
6892 mode_name: [0_u8; 35usize],
6893 };
6894 #[cfg(feature = "arbitrary")]
6895 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6896 use arbitrary::{Arbitrary, Unstructured};
6897 let mut buf = [0u8; 1024];
6898 rng.fill_bytes(&mut buf);
6899 let mut unstructured = Unstructured::new(&buf);
6900 Self::arbitrary(&mut unstructured).unwrap_or_default()
6901 }
6902}
6903impl Default for AVAILABLE_MODES_DATA {
6904 fn default() -> Self {
6905 Self::DEFAULT.clone()
6906 }
6907}
6908impl MessageData for AVAILABLE_MODES_DATA {
6909 type Message = MavMessage;
6910 const ID: u32 = 435u32;
6911 const NAME: &'static str = "AVAILABLE_MODES";
6912 const EXTRA_CRC: u8 = 134u8;
6913 const ENCODED_LEN: usize = 46usize;
6914 fn deser(
6915 _version: MavlinkVersion,
6916 __input: &[u8],
6917 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6918 let avail_len = __input.len();
6919 let mut payload_buf = [0; Self::ENCODED_LEN];
6920 let mut buf = if avail_len < Self::ENCODED_LEN {
6921 payload_buf[0..avail_len].copy_from_slice(__input);
6922 Bytes::new(&payload_buf)
6923 } else {
6924 Bytes::new(__input)
6925 };
6926 let mut __struct = Self::default();
6927 __struct.custom_mode = buf.get_u32_le();
6928 let tmp = buf.get_u32_le();
6929 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6930 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6931 flag_type: "MavModeProperty",
6932 value: tmp as u32,
6933 })?;
6934 __struct.number_modes = buf.get_u8();
6935 __struct.mode_index = buf.get_u8();
6936 let tmp = buf.get_u8();
6937 __struct.standard_mode =
6938 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6939 enum_type: "MavStandardMode",
6940 value: tmp as u32,
6941 })?;
6942 for v in &mut __struct.mode_name {
6943 let val = buf.get_u8();
6944 *v = val;
6945 }
6946 Ok(__struct)
6947 }
6948 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6949 let mut __tmp = BytesMut::new(bytes);
6950 #[allow(clippy::absurd_extreme_comparisons)]
6951 #[allow(unused_comparisons)]
6952 if __tmp.remaining() < Self::ENCODED_LEN {
6953 panic!(
6954 "buffer is too small (need {} bytes, but got {})",
6955 Self::ENCODED_LEN,
6956 __tmp.remaining(),
6957 )
6958 }
6959 __tmp.put_u32_le(self.custom_mode);
6960 __tmp.put_u32_le(self.properties.bits());
6961 __tmp.put_u8(self.number_modes);
6962 __tmp.put_u8(self.mode_index);
6963 __tmp.put_u8(self.standard_mode as u8);
6964 for val in &self.mode_name {
6965 __tmp.put_u8(*val);
6966 }
6967 if matches!(version, MavlinkVersion::V2) {
6968 let len = __tmp.len();
6969 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6970 } else {
6971 __tmp.len()
6972 }
6973 }
6974}
6975#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6976#[doc = ""]
6977#[doc = "ID: 437"]
6978#[derive(Debug, Clone, PartialEq)]
6979#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6980#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6981pub struct AVAILABLE_MODES_MONITOR_DATA {
6982 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6983 pub seq: u8,
6984}
6985impl AVAILABLE_MODES_MONITOR_DATA {
6986 pub const ENCODED_LEN: usize = 1usize;
6987 pub const DEFAULT: Self = Self { seq: 0_u8 };
6988 #[cfg(feature = "arbitrary")]
6989 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6990 use arbitrary::{Arbitrary, Unstructured};
6991 let mut buf = [0u8; 1024];
6992 rng.fill_bytes(&mut buf);
6993 let mut unstructured = Unstructured::new(&buf);
6994 Self::arbitrary(&mut unstructured).unwrap_or_default()
6995 }
6996}
6997impl Default for AVAILABLE_MODES_MONITOR_DATA {
6998 fn default() -> Self {
6999 Self::DEFAULT.clone()
7000 }
7001}
7002impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
7003 type Message = MavMessage;
7004 const ID: u32 = 437u32;
7005 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
7006 const EXTRA_CRC: u8 = 30u8;
7007 const ENCODED_LEN: usize = 1usize;
7008 fn deser(
7009 _version: MavlinkVersion,
7010 __input: &[u8],
7011 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7012 let avail_len = __input.len();
7013 let mut payload_buf = [0; Self::ENCODED_LEN];
7014 let mut buf = if avail_len < Self::ENCODED_LEN {
7015 payload_buf[0..avail_len].copy_from_slice(__input);
7016 Bytes::new(&payload_buf)
7017 } else {
7018 Bytes::new(__input)
7019 };
7020 let mut __struct = Self::default();
7021 __struct.seq = buf.get_u8();
7022 Ok(__struct)
7023 }
7024 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7025 let mut __tmp = BytesMut::new(bytes);
7026 #[allow(clippy::absurd_extreme_comparisons)]
7027 #[allow(unused_comparisons)]
7028 if __tmp.remaining() < Self::ENCODED_LEN {
7029 panic!(
7030 "buffer is too small (need {} bytes, but got {})",
7031 Self::ENCODED_LEN,
7032 __tmp.remaining(),
7033 )
7034 }
7035 __tmp.put_u8(self.seq);
7036 if matches!(version, MavlinkVersion::V2) {
7037 let len = __tmp.len();
7038 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7039 } else {
7040 __tmp.len()
7041 }
7042 }
7043}
7044#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
7045#[doc = ""]
7046#[doc = "ID: 372"]
7047#[derive(Debug, Clone, PartialEq)]
7048#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7050pub struct BATTERY_INFO_DATA {
7051 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
7052 pub discharge_minimum_voltage: f32,
7053 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
7054 pub charging_minimum_voltage: f32,
7055 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
7056 pub resting_minimum_voltage: f32,
7057 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
7058 pub charging_maximum_voltage: f32,
7059 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
7060 pub charging_maximum_current: f32,
7061 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
7062 pub nominal_voltage: f32,
7063 #[doc = "Maximum pack discharge current. 0: field not provided."]
7064 pub discharge_maximum_current: f32,
7065 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
7066 pub discharge_maximum_burst_current: f32,
7067 #[doc = "Fully charged design capacity. 0: field not provided."]
7068 pub design_capacity: f32,
7069 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
7070 pub full_charge_capacity: f32,
7071 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
7072 pub cycle_count: u16,
7073 #[doc = "Battery weight. 0: field not provided."]
7074 pub weight: u16,
7075 #[doc = "Battery ID"]
7076 pub id: u8,
7077 #[doc = "Function of the battery."]
7078 pub battery_function: MavBatteryFunction,
7079 #[doc = "Type (chemistry) of the battery."]
7080 pub mavtype: MavBatteryType,
7081 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
7082 pub state_of_health: u8,
7083 #[doc = "Number of battery cells in series. 0: field not provided."]
7084 pub cells_in_series: u8,
7085 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
7086 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7087 pub manufacture_date: [u8; 9],
7088 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
7089 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7090 pub serial_number: [u8; 32],
7091 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
7092 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7093 pub name: [u8; 50],
7094}
7095impl BATTERY_INFO_DATA {
7096 pub const ENCODED_LEN: usize = 140usize;
7097 pub const DEFAULT: Self = Self {
7098 discharge_minimum_voltage: 0.0_f32,
7099 charging_minimum_voltage: 0.0_f32,
7100 resting_minimum_voltage: 0.0_f32,
7101 charging_maximum_voltage: 0.0_f32,
7102 charging_maximum_current: 0.0_f32,
7103 nominal_voltage: 0.0_f32,
7104 discharge_maximum_current: 0.0_f32,
7105 discharge_maximum_burst_current: 0.0_f32,
7106 design_capacity: 0.0_f32,
7107 full_charge_capacity: 0.0_f32,
7108 cycle_count: 0_u16,
7109 weight: 0_u16,
7110 id: 0_u8,
7111 battery_function: MavBatteryFunction::DEFAULT,
7112 mavtype: MavBatteryType::DEFAULT,
7113 state_of_health: 0_u8,
7114 cells_in_series: 0_u8,
7115 manufacture_date: [0_u8; 9usize],
7116 serial_number: [0_u8; 32usize],
7117 name: [0_u8; 50usize],
7118 };
7119 #[cfg(feature = "arbitrary")]
7120 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7121 use arbitrary::{Arbitrary, Unstructured};
7122 let mut buf = [0u8; 1024];
7123 rng.fill_bytes(&mut buf);
7124 let mut unstructured = Unstructured::new(&buf);
7125 Self::arbitrary(&mut unstructured).unwrap_or_default()
7126 }
7127}
7128impl Default for BATTERY_INFO_DATA {
7129 fn default() -> Self {
7130 Self::DEFAULT.clone()
7131 }
7132}
7133impl MessageData for BATTERY_INFO_DATA {
7134 type Message = MavMessage;
7135 const ID: u32 = 372u32;
7136 const NAME: &'static str = "BATTERY_INFO";
7137 const EXTRA_CRC: u8 = 26u8;
7138 const ENCODED_LEN: usize = 140usize;
7139 fn deser(
7140 _version: MavlinkVersion,
7141 __input: &[u8],
7142 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7143 let avail_len = __input.len();
7144 let mut payload_buf = [0; Self::ENCODED_LEN];
7145 let mut buf = if avail_len < Self::ENCODED_LEN {
7146 payload_buf[0..avail_len].copy_from_slice(__input);
7147 Bytes::new(&payload_buf)
7148 } else {
7149 Bytes::new(__input)
7150 };
7151 let mut __struct = Self::default();
7152 __struct.discharge_minimum_voltage = buf.get_f32_le();
7153 __struct.charging_minimum_voltage = buf.get_f32_le();
7154 __struct.resting_minimum_voltage = buf.get_f32_le();
7155 __struct.charging_maximum_voltage = buf.get_f32_le();
7156 __struct.charging_maximum_current = buf.get_f32_le();
7157 __struct.nominal_voltage = buf.get_f32_le();
7158 __struct.discharge_maximum_current = buf.get_f32_le();
7159 __struct.discharge_maximum_burst_current = buf.get_f32_le();
7160 __struct.design_capacity = buf.get_f32_le();
7161 __struct.full_charge_capacity = buf.get_f32_le();
7162 __struct.cycle_count = buf.get_u16_le();
7163 __struct.weight = buf.get_u16_le();
7164 __struct.id = buf.get_u8();
7165 let tmp = buf.get_u8();
7166 __struct.battery_function =
7167 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7168 enum_type: "MavBatteryFunction",
7169 value: tmp as u32,
7170 })?;
7171 let tmp = buf.get_u8();
7172 __struct.mavtype =
7173 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7174 enum_type: "MavBatteryType",
7175 value: tmp as u32,
7176 })?;
7177 __struct.state_of_health = buf.get_u8();
7178 __struct.cells_in_series = buf.get_u8();
7179 for v in &mut __struct.manufacture_date {
7180 let val = buf.get_u8();
7181 *v = val;
7182 }
7183 for v in &mut __struct.serial_number {
7184 let val = buf.get_u8();
7185 *v = val;
7186 }
7187 for v in &mut __struct.name {
7188 let val = buf.get_u8();
7189 *v = val;
7190 }
7191 Ok(__struct)
7192 }
7193 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7194 let mut __tmp = BytesMut::new(bytes);
7195 #[allow(clippy::absurd_extreme_comparisons)]
7196 #[allow(unused_comparisons)]
7197 if __tmp.remaining() < Self::ENCODED_LEN {
7198 panic!(
7199 "buffer is too small (need {} bytes, but got {})",
7200 Self::ENCODED_LEN,
7201 __tmp.remaining(),
7202 )
7203 }
7204 __tmp.put_f32_le(self.discharge_minimum_voltage);
7205 __tmp.put_f32_le(self.charging_minimum_voltage);
7206 __tmp.put_f32_le(self.resting_minimum_voltage);
7207 __tmp.put_f32_le(self.charging_maximum_voltage);
7208 __tmp.put_f32_le(self.charging_maximum_current);
7209 __tmp.put_f32_le(self.nominal_voltage);
7210 __tmp.put_f32_le(self.discharge_maximum_current);
7211 __tmp.put_f32_le(self.discharge_maximum_burst_current);
7212 __tmp.put_f32_le(self.design_capacity);
7213 __tmp.put_f32_le(self.full_charge_capacity);
7214 __tmp.put_u16_le(self.cycle_count);
7215 __tmp.put_u16_le(self.weight);
7216 __tmp.put_u8(self.id);
7217 __tmp.put_u8(self.battery_function as u8);
7218 __tmp.put_u8(self.mavtype as u8);
7219 __tmp.put_u8(self.state_of_health);
7220 __tmp.put_u8(self.cells_in_series);
7221 for val in &self.manufacture_date {
7222 __tmp.put_u8(*val);
7223 }
7224 for val in &self.serial_number {
7225 __tmp.put_u8(*val);
7226 }
7227 for val in &self.name {
7228 __tmp.put_u8(*val);
7229 }
7230 if matches!(version, MavlinkVersion::V2) {
7231 let len = __tmp.len();
7232 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7233 } else {
7234 __tmp.len()
7235 }
7236 }
7237}
7238#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
7239#[doc = ""]
7240#[doc = "ID: 147"]
7241#[derive(Debug, Clone, PartialEq)]
7242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7244pub struct BATTERY_STATUS_DATA {
7245 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
7246 pub current_consumed: i32,
7247 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
7248 pub energy_consumed: i32,
7249 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
7250 pub temperature: i16,
7251 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
7252 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7253 pub voltages: [u16; 10],
7254 #[doc = "Battery current, -1: autopilot does not measure the current"]
7255 pub current_battery: i16,
7256 #[doc = "Battery ID"]
7257 pub id: u8,
7258 #[doc = "Function of the battery"]
7259 pub battery_function: MavBatteryFunction,
7260 #[doc = "Type (chemistry) of the battery"]
7261 pub mavtype: MavBatteryType,
7262 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
7263 pub battery_remaining: i8,
7264 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
7265 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7266 pub time_remaining: i32,
7267 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
7268 #[cfg_attr(feature = "serde", serde(default))]
7269 pub charge_state: MavBatteryChargeState,
7270 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
7271 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7272 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7273 pub voltages_ext: [u16; 4],
7274 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
7275 #[cfg_attr(feature = "serde", serde(default))]
7276 pub mode: MavBatteryMode,
7277 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
7278 #[cfg_attr(feature = "serde", serde(default))]
7279 pub fault_bitmask: MavBatteryFault,
7280}
7281impl BATTERY_STATUS_DATA {
7282 pub const ENCODED_LEN: usize = 54usize;
7283 pub const DEFAULT: Self = Self {
7284 current_consumed: 0_i32,
7285 energy_consumed: 0_i32,
7286 temperature: 0_i16,
7287 voltages: [0_u16; 10usize],
7288 current_battery: 0_i16,
7289 id: 0_u8,
7290 battery_function: MavBatteryFunction::DEFAULT,
7291 mavtype: MavBatteryType::DEFAULT,
7292 battery_remaining: 0_i8,
7293 time_remaining: 0_i32,
7294 charge_state: MavBatteryChargeState::DEFAULT,
7295 voltages_ext: [0_u16; 4usize],
7296 mode: MavBatteryMode::DEFAULT,
7297 fault_bitmask: MavBatteryFault::DEFAULT,
7298 };
7299 #[cfg(feature = "arbitrary")]
7300 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7301 use arbitrary::{Arbitrary, Unstructured};
7302 let mut buf = [0u8; 1024];
7303 rng.fill_bytes(&mut buf);
7304 let mut unstructured = Unstructured::new(&buf);
7305 Self::arbitrary(&mut unstructured).unwrap_or_default()
7306 }
7307}
7308impl Default for BATTERY_STATUS_DATA {
7309 fn default() -> Self {
7310 Self::DEFAULT.clone()
7311 }
7312}
7313impl MessageData for BATTERY_STATUS_DATA {
7314 type Message = MavMessage;
7315 const ID: u32 = 147u32;
7316 const NAME: &'static str = "BATTERY_STATUS";
7317 const EXTRA_CRC: u8 = 154u8;
7318 const ENCODED_LEN: usize = 54usize;
7319 fn deser(
7320 _version: MavlinkVersion,
7321 __input: &[u8],
7322 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7323 let avail_len = __input.len();
7324 let mut payload_buf = [0; Self::ENCODED_LEN];
7325 let mut buf = if avail_len < Self::ENCODED_LEN {
7326 payload_buf[0..avail_len].copy_from_slice(__input);
7327 Bytes::new(&payload_buf)
7328 } else {
7329 Bytes::new(__input)
7330 };
7331 let mut __struct = Self::default();
7332 __struct.current_consumed = buf.get_i32_le();
7333 __struct.energy_consumed = buf.get_i32_le();
7334 __struct.temperature = buf.get_i16_le();
7335 for v in &mut __struct.voltages {
7336 let val = buf.get_u16_le();
7337 *v = val;
7338 }
7339 __struct.current_battery = buf.get_i16_le();
7340 __struct.id = buf.get_u8();
7341 let tmp = buf.get_u8();
7342 __struct.battery_function =
7343 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7344 enum_type: "MavBatteryFunction",
7345 value: tmp as u32,
7346 })?;
7347 let tmp = buf.get_u8();
7348 __struct.mavtype =
7349 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7350 enum_type: "MavBatteryType",
7351 value: tmp as u32,
7352 })?;
7353 __struct.battery_remaining = buf.get_i8();
7354 __struct.time_remaining = buf.get_i32_le();
7355 let tmp = buf.get_u8();
7356 __struct.charge_state =
7357 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7358 enum_type: "MavBatteryChargeState",
7359 value: tmp as u32,
7360 })?;
7361 for v in &mut __struct.voltages_ext {
7362 let val = buf.get_u16_le();
7363 *v = val;
7364 }
7365 let tmp = buf.get_u8();
7366 __struct.mode =
7367 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7368 enum_type: "MavBatteryMode",
7369 value: tmp as u32,
7370 })?;
7371 let tmp = buf.get_u32_le();
7372 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
7373 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7374 flag_type: "MavBatteryFault",
7375 value: tmp as u32,
7376 })?;
7377 Ok(__struct)
7378 }
7379 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7380 let mut __tmp = BytesMut::new(bytes);
7381 #[allow(clippy::absurd_extreme_comparisons)]
7382 #[allow(unused_comparisons)]
7383 if __tmp.remaining() < Self::ENCODED_LEN {
7384 panic!(
7385 "buffer is too small (need {} bytes, but got {})",
7386 Self::ENCODED_LEN,
7387 __tmp.remaining(),
7388 )
7389 }
7390 __tmp.put_i32_le(self.current_consumed);
7391 __tmp.put_i32_le(self.energy_consumed);
7392 __tmp.put_i16_le(self.temperature);
7393 for val in &self.voltages {
7394 __tmp.put_u16_le(*val);
7395 }
7396 __tmp.put_i16_le(self.current_battery);
7397 __tmp.put_u8(self.id);
7398 __tmp.put_u8(self.battery_function as u8);
7399 __tmp.put_u8(self.mavtype as u8);
7400 __tmp.put_i8(self.battery_remaining);
7401 if matches!(version, MavlinkVersion::V2) {
7402 __tmp.put_i32_le(self.time_remaining);
7403 __tmp.put_u8(self.charge_state as u8);
7404 for val in &self.voltages_ext {
7405 __tmp.put_u16_le(*val);
7406 }
7407 __tmp.put_u8(self.mode as u8);
7408 __tmp.put_u32_le(self.fault_bitmask.bits());
7409 let len = __tmp.len();
7410 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7411 } else {
7412 __tmp.len()
7413 }
7414 }
7415}
7416#[doc = "Report button state change."]
7417#[doc = ""]
7418#[doc = "ID: 257"]
7419#[derive(Debug, Clone, PartialEq)]
7420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7422pub struct BUTTON_CHANGE_DATA {
7423 #[doc = "Timestamp (time since system boot)."]
7424 pub time_boot_ms: u32,
7425 #[doc = "Time of last change of button state."]
7426 pub last_change_ms: u32,
7427 #[doc = "Bitmap for state of buttons."]
7428 pub state: u8,
7429}
7430impl BUTTON_CHANGE_DATA {
7431 pub const ENCODED_LEN: usize = 9usize;
7432 pub const DEFAULT: Self = Self {
7433 time_boot_ms: 0_u32,
7434 last_change_ms: 0_u32,
7435 state: 0_u8,
7436 };
7437 #[cfg(feature = "arbitrary")]
7438 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7439 use arbitrary::{Arbitrary, Unstructured};
7440 let mut buf = [0u8; 1024];
7441 rng.fill_bytes(&mut buf);
7442 let mut unstructured = Unstructured::new(&buf);
7443 Self::arbitrary(&mut unstructured).unwrap_or_default()
7444 }
7445}
7446impl Default for BUTTON_CHANGE_DATA {
7447 fn default() -> Self {
7448 Self::DEFAULT.clone()
7449 }
7450}
7451impl MessageData for BUTTON_CHANGE_DATA {
7452 type Message = MavMessage;
7453 const ID: u32 = 257u32;
7454 const NAME: &'static str = "BUTTON_CHANGE";
7455 const EXTRA_CRC: u8 = 131u8;
7456 const ENCODED_LEN: usize = 9usize;
7457 fn deser(
7458 _version: MavlinkVersion,
7459 __input: &[u8],
7460 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7461 let avail_len = __input.len();
7462 let mut payload_buf = [0; Self::ENCODED_LEN];
7463 let mut buf = if avail_len < Self::ENCODED_LEN {
7464 payload_buf[0..avail_len].copy_from_slice(__input);
7465 Bytes::new(&payload_buf)
7466 } else {
7467 Bytes::new(__input)
7468 };
7469 let mut __struct = Self::default();
7470 __struct.time_boot_ms = buf.get_u32_le();
7471 __struct.last_change_ms = buf.get_u32_le();
7472 __struct.state = buf.get_u8();
7473 Ok(__struct)
7474 }
7475 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7476 let mut __tmp = BytesMut::new(bytes);
7477 #[allow(clippy::absurd_extreme_comparisons)]
7478 #[allow(unused_comparisons)]
7479 if __tmp.remaining() < Self::ENCODED_LEN {
7480 panic!(
7481 "buffer is too small (need {} bytes, but got {})",
7482 Self::ENCODED_LEN,
7483 __tmp.remaining(),
7484 )
7485 }
7486 __tmp.put_u32_le(self.time_boot_ms);
7487 __tmp.put_u32_le(self.last_change_ms);
7488 __tmp.put_u8(self.state);
7489 if matches!(version, MavlinkVersion::V2) {
7490 let len = __tmp.len();
7491 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7492 } else {
7493 __tmp.len()
7494 }
7495 }
7496}
7497#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7498#[doc = ""]
7499#[doc = "ID: 262"]
7500#[derive(Debug, Clone, PartialEq)]
7501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7503pub struct CAMERA_CAPTURE_STATUS_DATA {
7504 #[doc = "Timestamp (time since system boot)."]
7505 pub time_boot_ms: u32,
7506 #[doc = "Image capture interval"]
7507 pub image_interval: f32,
7508 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7509 pub recording_time_ms: u32,
7510 #[doc = "Available storage capacity."]
7511 pub available_capacity: f32,
7512 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7513 pub image_status: u8,
7514 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7515 pub video_status: u8,
7516 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7517 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7518 pub image_count: i32,
7519 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7520 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7521 pub camera_device_id: u8,
7522}
7523impl CAMERA_CAPTURE_STATUS_DATA {
7524 pub const ENCODED_LEN: usize = 23usize;
7525 pub const DEFAULT: Self = Self {
7526 time_boot_ms: 0_u32,
7527 image_interval: 0.0_f32,
7528 recording_time_ms: 0_u32,
7529 available_capacity: 0.0_f32,
7530 image_status: 0_u8,
7531 video_status: 0_u8,
7532 image_count: 0_i32,
7533 camera_device_id: 0_u8,
7534 };
7535 #[cfg(feature = "arbitrary")]
7536 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7537 use arbitrary::{Arbitrary, Unstructured};
7538 let mut buf = [0u8; 1024];
7539 rng.fill_bytes(&mut buf);
7540 let mut unstructured = Unstructured::new(&buf);
7541 Self::arbitrary(&mut unstructured).unwrap_or_default()
7542 }
7543}
7544impl Default for CAMERA_CAPTURE_STATUS_DATA {
7545 fn default() -> Self {
7546 Self::DEFAULT.clone()
7547 }
7548}
7549impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7550 type Message = MavMessage;
7551 const ID: u32 = 262u32;
7552 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7553 const EXTRA_CRC: u8 = 12u8;
7554 const ENCODED_LEN: usize = 23usize;
7555 fn deser(
7556 _version: MavlinkVersion,
7557 __input: &[u8],
7558 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7559 let avail_len = __input.len();
7560 let mut payload_buf = [0; Self::ENCODED_LEN];
7561 let mut buf = if avail_len < Self::ENCODED_LEN {
7562 payload_buf[0..avail_len].copy_from_slice(__input);
7563 Bytes::new(&payload_buf)
7564 } else {
7565 Bytes::new(__input)
7566 };
7567 let mut __struct = Self::default();
7568 __struct.time_boot_ms = buf.get_u32_le();
7569 __struct.image_interval = buf.get_f32_le();
7570 __struct.recording_time_ms = buf.get_u32_le();
7571 __struct.available_capacity = buf.get_f32_le();
7572 __struct.image_status = buf.get_u8();
7573 __struct.video_status = buf.get_u8();
7574 __struct.image_count = buf.get_i32_le();
7575 __struct.camera_device_id = buf.get_u8();
7576 Ok(__struct)
7577 }
7578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7579 let mut __tmp = BytesMut::new(bytes);
7580 #[allow(clippy::absurd_extreme_comparisons)]
7581 #[allow(unused_comparisons)]
7582 if __tmp.remaining() < Self::ENCODED_LEN {
7583 panic!(
7584 "buffer is too small (need {} bytes, but got {})",
7585 Self::ENCODED_LEN,
7586 __tmp.remaining(),
7587 )
7588 }
7589 __tmp.put_u32_le(self.time_boot_ms);
7590 __tmp.put_f32_le(self.image_interval);
7591 __tmp.put_u32_le(self.recording_time_ms);
7592 __tmp.put_f32_le(self.available_capacity);
7593 __tmp.put_u8(self.image_status);
7594 __tmp.put_u8(self.video_status);
7595 if matches!(version, MavlinkVersion::V2) {
7596 __tmp.put_i32_le(self.image_count);
7597 __tmp.put_u8(self.camera_device_id);
7598 let len = __tmp.len();
7599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7600 } else {
7601 __tmp.len()
7602 }
7603 }
7604}
7605#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7606#[doc = ""]
7607#[doc = "ID: 271"]
7608#[derive(Debug, Clone, PartialEq)]
7609#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7611pub struct CAMERA_FOV_STATUS_DATA {
7612 #[doc = "Timestamp (time since system boot)."]
7613 pub time_boot_ms: u32,
7614 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7615 pub lat_camera: i32,
7616 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7617 pub lon_camera: i32,
7618 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7619 pub alt_camera: i32,
7620 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7621 pub lat_image: i32,
7622 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7623 pub lon_image: i32,
7624 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7625 pub alt_image: i32,
7626 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7627 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7628 pub q: [f32; 4],
7629 #[doc = "Horizontal field of view (NaN if unknown)."]
7630 pub hfov: f32,
7631 #[doc = "Vertical field of view (NaN if unknown)."]
7632 pub vfov: f32,
7633 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7634 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7635 pub camera_device_id: u8,
7636}
7637impl CAMERA_FOV_STATUS_DATA {
7638 pub const ENCODED_LEN: usize = 53usize;
7639 pub const DEFAULT: Self = Self {
7640 time_boot_ms: 0_u32,
7641 lat_camera: 0_i32,
7642 lon_camera: 0_i32,
7643 alt_camera: 0_i32,
7644 lat_image: 0_i32,
7645 lon_image: 0_i32,
7646 alt_image: 0_i32,
7647 q: [0.0_f32; 4usize],
7648 hfov: 0.0_f32,
7649 vfov: 0.0_f32,
7650 camera_device_id: 0_u8,
7651 };
7652 #[cfg(feature = "arbitrary")]
7653 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7654 use arbitrary::{Arbitrary, Unstructured};
7655 let mut buf = [0u8; 1024];
7656 rng.fill_bytes(&mut buf);
7657 let mut unstructured = Unstructured::new(&buf);
7658 Self::arbitrary(&mut unstructured).unwrap_or_default()
7659 }
7660}
7661impl Default for CAMERA_FOV_STATUS_DATA {
7662 fn default() -> Self {
7663 Self::DEFAULT.clone()
7664 }
7665}
7666impl MessageData for CAMERA_FOV_STATUS_DATA {
7667 type Message = MavMessage;
7668 const ID: u32 = 271u32;
7669 const NAME: &'static str = "CAMERA_FOV_STATUS";
7670 const EXTRA_CRC: u8 = 22u8;
7671 const ENCODED_LEN: usize = 53usize;
7672 fn deser(
7673 _version: MavlinkVersion,
7674 __input: &[u8],
7675 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7676 let avail_len = __input.len();
7677 let mut payload_buf = [0; Self::ENCODED_LEN];
7678 let mut buf = if avail_len < Self::ENCODED_LEN {
7679 payload_buf[0..avail_len].copy_from_slice(__input);
7680 Bytes::new(&payload_buf)
7681 } else {
7682 Bytes::new(__input)
7683 };
7684 let mut __struct = Self::default();
7685 __struct.time_boot_ms = buf.get_u32_le();
7686 __struct.lat_camera = buf.get_i32_le();
7687 __struct.lon_camera = buf.get_i32_le();
7688 __struct.alt_camera = buf.get_i32_le();
7689 __struct.lat_image = buf.get_i32_le();
7690 __struct.lon_image = buf.get_i32_le();
7691 __struct.alt_image = buf.get_i32_le();
7692 for v in &mut __struct.q {
7693 let val = buf.get_f32_le();
7694 *v = val;
7695 }
7696 __struct.hfov = buf.get_f32_le();
7697 __struct.vfov = buf.get_f32_le();
7698 __struct.camera_device_id = buf.get_u8();
7699 Ok(__struct)
7700 }
7701 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7702 let mut __tmp = BytesMut::new(bytes);
7703 #[allow(clippy::absurd_extreme_comparisons)]
7704 #[allow(unused_comparisons)]
7705 if __tmp.remaining() < Self::ENCODED_LEN {
7706 panic!(
7707 "buffer is too small (need {} bytes, but got {})",
7708 Self::ENCODED_LEN,
7709 __tmp.remaining(),
7710 )
7711 }
7712 __tmp.put_u32_le(self.time_boot_ms);
7713 __tmp.put_i32_le(self.lat_camera);
7714 __tmp.put_i32_le(self.lon_camera);
7715 __tmp.put_i32_le(self.alt_camera);
7716 __tmp.put_i32_le(self.lat_image);
7717 __tmp.put_i32_le(self.lon_image);
7718 __tmp.put_i32_le(self.alt_image);
7719 for val in &self.q {
7720 __tmp.put_f32_le(*val);
7721 }
7722 __tmp.put_f32_le(self.hfov);
7723 __tmp.put_f32_le(self.vfov);
7724 if matches!(version, MavlinkVersion::V2) {
7725 __tmp.put_u8(self.camera_device_id);
7726 let len = __tmp.len();
7727 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7728 } else {
7729 __tmp.len()
7730 }
7731 }
7732}
7733#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7734#[doc = ""]
7735#[doc = "ID: 263"]
7736#[derive(Debug, Clone, PartialEq)]
7737#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7738#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7739pub struct CAMERA_IMAGE_CAPTURED_DATA {
7740 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7741 pub time_utc: u64,
7742 #[doc = "Timestamp (time since system boot)."]
7743 pub time_boot_ms: u32,
7744 #[doc = "Latitude where image was taken"]
7745 pub lat: i32,
7746 #[doc = "Longitude where capture was taken"]
7747 pub lon: i32,
7748 #[doc = "Altitude (MSL) where image was taken"]
7749 pub alt: i32,
7750 #[doc = "Altitude above ground"]
7751 pub relative_alt: i32,
7752 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7753 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7754 pub q: [f32; 4],
7755 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7756 pub image_index: i32,
7757 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7758 pub camera_id: u8,
7759 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7760 pub capture_result: i8,
7761 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7762 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7763 pub file_url: [u8; 205],
7764}
7765impl CAMERA_IMAGE_CAPTURED_DATA {
7766 pub const ENCODED_LEN: usize = 255usize;
7767 pub const DEFAULT: Self = Self {
7768 time_utc: 0_u64,
7769 time_boot_ms: 0_u32,
7770 lat: 0_i32,
7771 lon: 0_i32,
7772 alt: 0_i32,
7773 relative_alt: 0_i32,
7774 q: [0.0_f32; 4usize],
7775 image_index: 0_i32,
7776 camera_id: 0_u8,
7777 capture_result: 0_i8,
7778 file_url: [0_u8; 205usize],
7779 };
7780 #[cfg(feature = "arbitrary")]
7781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7782 use arbitrary::{Arbitrary, Unstructured};
7783 let mut buf = [0u8; 1024];
7784 rng.fill_bytes(&mut buf);
7785 let mut unstructured = Unstructured::new(&buf);
7786 Self::arbitrary(&mut unstructured).unwrap_or_default()
7787 }
7788}
7789impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7790 fn default() -> Self {
7791 Self::DEFAULT.clone()
7792 }
7793}
7794impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7795 type Message = MavMessage;
7796 const ID: u32 = 263u32;
7797 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7798 const EXTRA_CRC: u8 = 133u8;
7799 const ENCODED_LEN: usize = 255usize;
7800 fn deser(
7801 _version: MavlinkVersion,
7802 __input: &[u8],
7803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7804 let avail_len = __input.len();
7805 let mut payload_buf = [0; Self::ENCODED_LEN];
7806 let mut buf = if avail_len < Self::ENCODED_LEN {
7807 payload_buf[0..avail_len].copy_from_slice(__input);
7808 Bytes::new(&payload_buf)
7809 } else {
7810 Bytes::new(__input)
7811 };
7812 let mut __struct = Self::default();
7813 __struct.time_utc = buf.get_u64_le();
7814 __struct.time_boot_ms = buf.get_u32_le();
7815 __struct.lat = buf.get_i32_le();
7816 __struct.lon = buf.get_i32_le();
7817 __struct.alt = buf.get_i32_le();
7818 __struct.relative_alt = buf.get_i32_le();
7819 for v in &mut __struct.q {
7820 let val = buf.get_f32_le();
7821 *v = val;
7822 }
7823 __struct.image_index = buf.get_i32_le();
7824 __struct.camera_id = buf.get_u8();
7825 __struct.capture_result = buf.get_i8();
7826 for v in &mut __struct.file_url {
7827 let val = buf.get_u8();
7828 *v = val;
7829 }
7830 Ok(__struct)
7831 }
7832 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7833 let mut __tmp = BytesMut::new(bytes);
7834 #[allow(clippy::absurd_extreme_comparisons)]
7835 #[allow(unused_comparisons)]
7836 if __tmp.remaining() < Self::ENCODED_LEN {
7837 panic!(
7838 "buffer is too small (need {} bytes, but got {})",
7839 Self::ENCODED_LEN,
7840 __tmp.remaining(),
7841 )
7842 }
7843 __tmp.put_u64_le(self.time_utc);
7844 __tmp.put_u32_le(self.time_boot_ms);
7845 __tmp.put_i32_le(self.lat);
7846 __tmp.put_i32_le(self.lon);
7847 __tmp.put_i32_le(self.alt);
7848 __tmp.put_i32_le(self.relative_alt);
7849 for val in &self.q {
7850 __tmp.put_f32_le(*val);
7851 }
7852 __tmp.put_i32_le(self.image_index);
7853 __tmp.put_u8(self.camera_id);
7854 __tmp.put_i8(self.capture_result);
7855 for val in &self.file_url {
7856 __tmp.put_u8(*val);
7857 }
7858 if matches!(version, MavlinkVersion::V2) {
7859 let len = __tmp.len();
7860 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7861 } else {
7862 __tmp.len()
7863 }
7864 }
7865}
7866#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7867#[doc = ""]
7868#[doc = "ID: 259"]
7869#[derive(Debug, Clone, PartialEq)]
7870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7872pub struct CAMERA_INFORMATION_DATA {
7873 #[doc = "Timestamp (time since system boot)."]
7874 pub time_boot_ms: u32,
7875 #[doc = "0xff). Use 0 if not known."]
7876 pub firmware_version: u32,
7877 #[doc = "Focal length. Use NaN if not known."]
7878 pub focal_length: f32,
7879 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7880 pub sensor_size_h: f32,
7881 #[doc = "Image sensor size vertical. Use NaN if not known."]
7882 pub sensor_size_v: f32,
7883 #[doc = "Bitmap of camera capability flags."]
7884 pub flags: CameraCapFlags,
7885 #[doc = "Horizontal image resolution. Use 0 if not known."]
7886 pub resolution_h: u16,
7887 #[doc = "Vertical image resolution. Use 0 if not known."]
7888 pub resolution_v: u16,
7889 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7890 pub cam_definition_version: u16,
7891 #[doc = "Name of the camera vendor"]
7892 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7893 pub vendor_name: [u8; 32],
7894 #[doc = "Name of the camera model"]
7895 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7896 pub model_name: [u8; 32],
7897 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7898 pub lens_id: u8,
7899 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7900 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7901 pub cam_definition_uri: [u8; 140],
7902 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7903 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7904 pub gimbal_device_id: u8,
7905 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7906 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7907 pub camera_device_id: u8,
7908}
7909impl CAMERA_INFORMATION_DATA {
7910 pub const ENCODED_LEN: usize = 237usize;
7911 pub const DEFAULT: Self = Self {
7912 time_boot_ms: 0_u32,
7913 firmware_version: 0_u32,
7914 focal_length: 0.0_f32,
7915 sensor_size_h: 0.0_f32,
7916 sensor_size_v: 0.0_f32,
7917 flags: CameraCapFlags::DEFAULT,
7918 resolution_h: 0_u16,
7919 resolution_v: 0_u16,
7920 cam_definition_version: 0_u16,
7921 vendor_name: [0_u8; 32usize],
7922 model_name: [0_u8; 32usize],
7923 lens_id: 0_u8,
7924 cam_definition_uri: [0_u8; 140usize],
7925 gimbal_device_id: 0_u8,
7926 camera_device_id: 0_u8,
7927 };
7928 #[cfg(feature = "arbitrary")]
7929 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7930 use arbitrary::{Arbitrary, Unstructured};
7931 let mut buf = [0u8; 1024];
7932 rng.fill_bytes(&mut buf);
7933 let mut unstructured = Unstructured::new(&buf);
7934 Self::arbitrary(&mut unstructured).unwrap_or_default()
7935 }
7936}
7937impl Default for CAMERA_INFORMATION_DATA {
7938 fn default() -> Self {
7939 Self::DEFAULT.clone()
7940 }
7941}
7942impl MessageData for CAMERA_INFORMATION_DATA {
7943 type Message = MavMessage;
7944 const ID: u32 = 259u32;
7945 const NAME: &'static str = "CAMERA_INFORMATION";
7946 const EXTRA_CRC: u8 = 92u8;
7947 const ENCODED_LEN: usize = 237usize;
7948 fn deser(
7949 _version: MavlinkVersion,
7950 __input: &[u8],
7951 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7952 let avail_len = __input.len();
7953 let mut payload_buf = [0; Self::ENCODED_LEN];
7954 let mut buf = if avail_len < Self::ENCODED_LEN {
7955 payload_buf[0..avail_len].copy_from_slice(__input);
7956 Bytes::new(&payload_buf)
7957 } else {
7958 Bytes::new(__input)
7959 };
7960 let mut __struct = Self::default();
7961 __struct.time_boot_ms = buf.get_u32_le();
7962 __struct.firmware_version = buf.get_u32_le();
7963 __struct.focal_length = buf.get_f32_le();
7964 __struct.sensor_size_h = buf.get_f32_le();
7965 __struct.sensor_size_v = buf.get_f32_le();
7966 let tmp = buf.get_u32_le();
7967 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7968 ::mavlink_core::error::ParserError::InvalidFlag {
7969 flag_type: "CameraCapFlags",
7970 value: tmp as u32,
7971 },
7972 )?;
7973 __struct.resolution_h = buf.get_u16_le();
7974 __struct.resolution_v = buf.get_u16_le();
7975 __struct.cam_definition_version = buf.get_u16_le();
7976 for v in &mut __struct.vendor_name {
7977 let val = buf.get_u8();
7978 *v = val;
7979 }
7980 for v in &mut __struct.model_name {
7981 let val = buf.get_u8();
7982 *v = val;
7983 }
7984 __struct.lens_id = buf.get_u8();
7985 for v in &mut __struct.cam_definition_uri {
7986 let val = buf.get_u8();
7987 *v = val;
7988 }
7989 __struct.gimbal_device_id = buf.get_u8();
7990 __struct.camera_device_id = buf.get_u8();
7991 Ok(__struct)
7992 }
7993 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7994 let mut __tmp = BytesMut::new(bytes);
7995 #[allow(clippy::absurd_extreme_comparisons)]
7996 #[allow(unused_comparisons)]
7997 if __tmp.remaining() < Self::ENCODED_LEN {
7998 panic!(
7999 "buffer is too small (need {} bytes, but got {})",
8000 Self::ENCODED_LEN,
8001 __tmp.remaining(),
8002 )
8003 }
8004 __tmp.put_u32_le(self.time_boot_ms);
8005 __tmp.put_u32_le(self.firmware_version);
8006 __tmp.put_f32_le(self.focal_length);
8007 __tmp.put_f32_le(self.sensor_size_h);
8008 __tmp.put_f32_le(self.sensor_size_v);
8009 __tmp.put_u32_le(self.flags.bits());
8010 __tmp.put_u16_le(self.resolution_h);
8011 __tmp.put_u16_le(self.resolution_v);
8012 __tmp.put_u16_le(self.cam_definition_version);
8013 for val in &self.vendor_name {
8014 __tmp.put_u8(*val);
8015 }
8016 for val in &self.model_name {
8017 __tmp.put_u8(*val);
8018 }
8019 __tmp.put_u8(self.lens_id);
8020 for val in &self.cam_definition_uri {
8021 __tmp.put_u8(*val);
8022 }
8023 if matches!(version, MavlinkVersion::V2) {
8024 __tmp.put_u8(self.gimbal_device_id);
8025 __tmp.put_u8(self.camera_device_id);
8026 let len = __tmp.len();
8027 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8028 } else {
8029 __tmp.len()
8030 }
8031 }
8032}
8033#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
8034#[doc = ""]
8035#[doc = "ID: 260"]
8036#[derive(Debug, Clone, PartialEq)]
8037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8038#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8039pub struct CAMERA_SETTINGS_DATA {
8040 #[doc = "Timestamp (time since system boot)."]
8041 pub time_boot_ms: u32,
8042 #[doc = "Camera mode"]
8043 pub mode_id: CameraMode,
8044 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
8045 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8046 pub zoomLevel: f32,
8047 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
8048 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8049 pub focusLevel: f32,
8050 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8051 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8052 pub camera_device_id: u8,
8053}
8054impl CAMERA_SETTINGS_DATA {
8055 pub const ENCODED_LEN: usize = 14usize;
8056 pub const DEFAULT: Self = Self {
8057 time_boot_ms: 0_u32,
8058 mode_id: CameraMode::DEFAULT,
8059 zoomLevel: 0.0_f32,
8060 focusLevel: 0.0_f32,
8061 camera_device_id: 0_u8,
8062 };
8063 #[cfg(feature = "arbitrary")]
8064 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8065 use arbitrary::{Arbitrary, Unstructured};
8066 let mut buf = [0u8; 1024];
8067 rng.fill_bytes(&mut buf);
8068 let mut unstructured = Unstructured::new(&buf);
8069 Self::arbitrary(&mut unstructured).unwrap_or_default()
8070 }
8071}
8072impl Default for CAMERA_SETTINGS_DATA {
8073 fn default() -> Self {
8074 Self::DEFAULT.clone()
8075 }
8076}
8077impl MessageData for CAMERA_SETTINGS_DATA {
8078 type Message = MavMessage;
8079 const ID: u32 = 260u32;
8080 const NAME: &'static str = "CAMERA_SETTINGS";
8081 const EXTRA_CRC: u8 = 146u8;
8082 const ENCODED_LEN: usize = 14usize;
8083 fn deser(
8084 _version: MavlinkVersion,
8085 __input: &[u8],
8086 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8087 let avail_len = __input.len();
8088 let mut payload_buf = [0; Self::ENCODED_LEN];
8089 let mut buf = if avail_len < Self::ENCODED_LEN {
8090 payload_buf[0..avail_len].copy_from_slice(__input);
8091 Bytes::new(&payload_buf)
8092 } else {
8093 Bytes::new(__input)
8094 };
8095 let mut __struct = Self::default();
8096 __struct.time_boot_ms = buf.get_u32_le();
8097 let tmp = buf.get_u8();
8098 __struct.mode_id =
8099 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8100 enum_type: "CameraMode",
8101 value: tmp as u32,
8102 })?;
8103 __struct.zoomLevel = buf.get_f32_le();
8104 __struct.focusLevel = buf.get_f32_le();
8105 __struct.camera_device_id = buf.get_u8();
8106 Ok(__struct)
8107 }
8108 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8109 let mut __tmp = BytesMut::new(bytes);
8110 #[allow(clippy::absurd_extreme_comparisons)]
8111 #[allow(unused_comparisons)]
8112 if __tmp.remaining() < Self::ENCODED_LEN {
8113 panic!(
8114 "buffer is too small (need {} bytes, but got {})",
8115 Self::ENCODED_LEN,
8116 __tmp.remaining(),
8117 )
8118 }
8119 __tmp.put_u32_le(self.time_boot_ms);
8120 __tmp.put_u8(self.mode_id as u8);
8121 if matches!(version, MavlinkVersion::V2) {
8122 __tmp.put_f32_le(self.zoomLevel);
8123 __tmp.put_f32_le(self.focusLevel);
8124 __tmp.put_u8(self.camera_device_id);
8125 let len = __tmp.len();
8126 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8127 } else {
8128 __tmp.len()
8129 }
8130 }
8131}
8132#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
8133#[doc = ""]
8134#[doc = "ID: 277"]
8135#[derive(Debug, Clone, PartialEq)]
8136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8138pub struct CAMERA_THERMAL_RANGE_DATA {
8139 #[doc = "Timestamp (time since system boot)."]
8140 pub time_boot_ms: u32,
8141 #[doc = "Temperature max."]
8142 pub max: f32,
8143 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
8144 pub max_point_x: f32,
8145 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
8146 pub max_point_y: f32,
8147 #[doc = "Temperature min."]
8148 pub min: f32,
8149 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
8150 pub min_point_x: f32,
8151 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
8152 pub min_point_y: f32,
8153 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
8154 pub stream_id: u8,
8155 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8156 pub camera_device_id: u8,
8157}
8158impl CAMERA_THERMAL_RANGE_DATA {
8159 pub const ENCODED_LEN: usize = 30usize;
8160 pub const DEFAULT: Self = Self {
8161 time_boot_ms: 0_u32,
8162 max: 0.0_f32,
8163 max_point_x: 0.0_f32,
8164 max_point_y: 0.0_f32,
8165 min: 0.0_f32,
8166 min_point_x: 0.0_f32,
8167 min_point_y: 0.0_f32,
8168 stream_id: 0_u8,
8169 camera_device_id: 0_u8,
8170 };
8171 #[cfg(feature = "arbitrary")]
8172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8173 use arbitrary::{Arbitrary, Unstructured};
8174 let mut buf = [0u8; 1024];
8175 rng.fill_bytes(&mut buf);
8176 let mut unstructured = Unstructured::new(&buf);
8177 Self::arbitrary(&mut unstructured).unwrap_or_default()
8178 }
8179}
8180impl Default for CAMERA_THERMAL_RANGE_DATA {
8181 fn default() -> Self {
8182 Self::DEFAULT.clone()
8183 }
8184}
8185impl MessageData for CAMERA_THERMAL_RANGE_DATA {
8186 type Message = MavMessage;
8187 const ID: u32 = 277u32;
8188 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
8189 const EXTRA_CRC: u8 = 62u8;
8190 const ENCODED_LEN: usize = 30usize;
8191 fn deser(
8192 _version: MavlinkVersion,
8193 __input: &[u8],
8194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8195 let avail_len = __input.len();
8196 let mut payload_buf = [0; Self::ENCODED_LEN];
8197 let mut buf = if avail_len < Self::ENCODED_LEN {
8198 payload_buf[0..avail_len].copy_from_slice(__input);
8199 Bytes::new(&payload_buf)
8200 } else {
8201 Bytes::new(__input)
8202 };
8203 let mut __struct = Self::default();
8204 __struct.time_boot_ms = buf.get_u32_le();
8205 __struct.max = buf.get_f32_le();
8206 __struct.max_point_x = buf.get_f32_le();
8207 __struct.max_point_y = buf.get_f32_le();
8208 __struct.min = buf.get_f32_le();
8209 __struct.min_point_x = buf.get_f32_le();
8210 __struct.min_point_y = buf.get_f32_le();
8211 __struct.stream_id = buf.get_u8();
8212 __struct.camera_device_id = buf.get_u8();
8213 Ok(__struct)
8214 }
8215 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8216 let mut __tmp = BytesMut::new(bytes);
8217 #[allow(clippy::absurd_extreme_comparisons)]
8218 #[allow(unused_comparisons)]
8219 if __tmp.remaining() < Self::ENCODED_LEN {
8220 panic!(
8221 "buffer is too small (need {} bytes, but got {})",
8222 Self::ENCODED_LEN,
8223 __tmp.remaining(),
8224 )
8225 }
8226 __tmp.put_u32_le(self.time_boot_ms);
8227 __tmp.put_f32_le(self.max);
8228 __tmp.put_f32_le(self.max_point_x);
8229 __tmp.put_f32_le(self.max_point_y);
8230 __tmp.put_f32_le(self.min);
8231 __tmp.put_f32_le(self.min_point_x);
8232 __tmp.put_f32_le(self.min_point_y);
8233 __tmp.put_u8(self.stream_id);
8234 __tmp.put_u8(self.camera_device_id);
8235 if matches!(version, MavlinkVersion::V2) {
8236 let len = __tmp.len();
8237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8238 } else {
8239 __tmp.len()
8240 }
8241 }
8242}
8243#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8244#[doc = ""]
8245#[doc = "ID: 276"]
8246#[derive(Debug, Clone, PartialEq)]
8247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8249pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
8250 #[doc = "Latitude of tracked object"]
8251 pub lat: i32,
8252 #[doc = "Longitude of tracked object"]
8253 pub lon: i32,
8254 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
8255 pub alt: f32,
8256 #[doc = "Horizontal accuracy. NAN if unknown"]
8257 pub h_acc: f32,
8258 #[doc = "Vertical accuracy. NAN if unknown"]
8259 pub v_acc: f32,
8260 #[doc = "North velocity of tracked object. NAN if unknown"]
8261 pub vel_n: f32,
8262 #[doc = "East velocity of tracked object. NAN if unknown"]
8263 pub vel_e: f32,
8264 #[doc = "Down velocity of tracked object. NAN if unknown"]
8265 pub vel_d: f32,
8266 #[doc = "Velocity accuracy. NAN if unknown"]
8267 pub vel_acc: f32,
8268 #[doc = "Distance between camera and tracked object. NAN if unknown"]
8269 pub dist: f32,
8270 #[doc = "Heading in radians, in NED. NAN if unknown"]
8271 pub hdg: f32,
8272 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
8273 pub hdg_acc: f32,
8274 #[doc = "Current tracking status"]
8275 pub tracking_status: CameraTrackingStatusFlags,
8276 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8277 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8278 pub camera_device_id: u8,
8279}
8280impl CAMERA_TRACKING_GEO_STATUS_DATA {
8281 pub const ENCODED_LEN: usize = 50usize;
8282 pub const DEFAULT: Self = Self {
8283 lat: 0_i32,
8284 lon: 0_i32,
8285 alt: 0.0_f32,
8286 h_acc: 0.0_f32,
8287 v_acc: 0.0_f32,
8288 vel_n: 0.0_f32,
8289 vel_e: 0.0_f32,
8290 vel_d: 0.0_f32,
8291 vel_acc: 0.0_f32,
8292 dist: 0.0_f32,
8293 hdg: 0.0_f32,
8294 hdg_acc: 0.0_f32,
8295 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8296 camera_device_id: 0_u8,
8297 };
8298 #[cfg(feature = "arbitrary")]
8299 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8300 use arbitrary::{Arbitrary, Unstructured};
8301 let mut buf = [0u8; 1024];
8302 rng.fill_bytes(&mut buf);
8303 let mut unstructured = Unstructured::new(&buf);
8304 Self::arbitrary(&mut unstructured).unwrap_or_default()
8305 }
8306}
8307impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
8308 fn default() -> Self {
8309 Self::DEFAULT.clone()
8310 }
8311}
8312impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
8313 type Message = MavMessage;
8314 const ID: u32 = 276u32;
8315 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
8316 const EXTRA_CRC: u8 = 18u8;
8317 const ENCODED_LEN: usize = 50usize;
8318 fn deser(
8319 _version: MavlinkVersion,
8320 __input: &[u8],
8321 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8322 let avail_len = __input.len();
8323 let mut payload_buf = [0; Self::ENCODED_LEN];
8324 let mut buf = if avail_len < Self::ENCODED_LEN {
8325 payload_buf[0..avail_len].copy_from_slice(__input);
8326 Bytes::new(&payload_buf)
8327 } else {
8328 Bytes::new(__input)
8329 };
8330 let mut __struct = Self::default();
8331 __struct.lat = buf.get_i32_le();
8332 __struct.lon = buf.get_i32_le();
8333 __struct.alt = buf.get_f32_le();
8334 __struct.h_acc = buf.get_f32_le();
8335 __struct.v_acc = buf.get_f32_le();
8336 __struct.vel_n = buf.get_f32_le();
8337 __struct.vel_e = buf.get_f32_le();
8338 __struct.vel_d = buf.get_f32_le();
8339 __struct.vel_acc = buf.get_f32_le();
8340 __struct.dist = buf.get_f32_le();
8341 __struct.hdg = buf.get_f32_le();
8342 __struct.hdg_acc = buf.get_f32_le();
8343 let tmp = buf.get_u8();
8344 __struct.tracking_status =
8345 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8346 enum_type: "CameraTrackingStatusFlags",
8347 value: tmp as u32,
8348 })?;
8349 __struct.camera_device_id = buf.get_u8();
8350 Ok(__struct)
8351 }
8352 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8353 let mut __tmp = BytesMut::new(bytes);
8354 #[allow(clippy::absurd_extreme_comparisons)]
8355 #[allow(unused_comparisons)]
8356 if __tmp.remaining() < Self::ENCODED_LEN {
8357 panic!(
8358 "buffer is too small (need {} bytes, but got {})",
8359 Self::ENCODED_LEN,
8360 __tmp.remaining(),
8361 )
8362 }
8363 __tmp.put_i32_le(self.lat);
8364 __tmp.put_i32_le(self.lon);
8365 __tmp.put_f32_le(self.alt);
8366 __tmp.put_f32_le(self.h_acc);
8367 __tmp.put_f32_le(self.v_acc);
8368 __tmp.put_f32_le(self.vel_n);
8369 __tmp.put_f32_le(self.vel_e);
8370 __tmp.put_f32_le(self.vel_d);
8371 __tmp.put_f32_le(self.vel_acc);
8372 __tmp.put_f32_le(self.dist);
8373 __tmp.put_f32_le(self.hdg);
8374 __tmp.put_f32_le(self.hdg_acc);
8375 __tmp.put_u8(self.tracking_status as u8);
8376 if matches!(version, MavlinkVersion::V2) {
8377 __tmp.put_u8(self.camera_device_id);
8378 let len = __tmp.len();
8379 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8380 } else {
8381 __tmp.len()
8382 }
8383 }
8384}
8385#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8386#[doc = ""]
8387#[doc = "ID: 275"]
8388#[derive(Debug, Clone, PartialEq)]
8389#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8390#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8391pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
8392 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8393 pub point_x: f32,
8394 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8395 pub point_y: f32,
8396 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
8397 pub radius: f32,
8398 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8399 pub rec_top_x: f32,
8400 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8401 pub rec_top_y: f32,
8402 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8403 pub rec_bottom_x: f32,
8404 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8405 pub rec_bottom_y: f32,
8406 #[doc = "Current tracking status"]
8407 pub tracking_status: CameraTrackingStatusFlags,
8408 #[doc = "Current tracking mode"]
8409 pub tracking_mode: CameraTrackingMode,
8410 #[doc = "Defines location of target data"]
8411 pub target_data: CameraTrackingTargetData,
8412 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8413 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8414 pub camera_device_id: u8,
8415}
8416impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
8417 pub const ENCODED_LEN: usize = 32usize;
8418 pub const DEFAULT: Self = Self {
8419 point_x: 0.0_f32,
8420 point_y: 0.0_f32,
8421 radius: 0.0_f32,
8422 rec_top_x: 0.0_f32,
8423 rec_top_y: 0.0_f32,
8424 rec_bottom_x: 0.0_f32,
8425 rec_bottom_y: 0.0_f32,
8426 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8427 tracking_mode: CameraTrackingMode::DEFAULT,
8428 target_data: CameraTrackingTargetData::DEFAULT,
8429 camera_device_id: 0_u8,
8430 };
8431 #[cfg(feature = "arbitrary")]
8432 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8433 use arbitrary::{Arbitrary, Unstructured};
8434 let mut buf = [0u8; 1024];
8435 rng.fill_bytes(&mut buf);
8436 let mut unstructured = Unstructured::new(&buf);
8437 Self::arbitrary(&mut unstructured).unwrap_or_default()
8438 }
8439}
8440impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8441 fn default() -> Self {
8442 Self::DEFAULT.clone()
8443 }
8444}
8445impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8446 type Message = MavMessage;
8447 const ID: u32 = 275u32;
8448 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8449 const EXTRA_CRC: u8 = 126u8;
8450 const ENCODED_LEN: usize = 32usize;
8451 fn deser(
8452 _version: MavlinkVersion,
8453 __input: &[u8],
8454 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8455 let avail_len = __input.len();
8456 let mut payload_buf = [0; Self::ENCODED_LEN];
8457 let mut buf = if avail_len < Self::ENCODED_LEN {
8458 payload_buf[0..avail_len].copy_from_slice(__input);
8459 Bytes::new(&payload_buf)
8460 } else {
8461 Bytes::new(__input)
8462 };
8463 let mut __struct = Self::default();
8464 __struct.point_x = buf.get_f32_le();
8465 __struct.point_y = buf.get_f32_le();
8466 __struct.radius = buf.get_f32_le();
8467 __struct.rec_top_x = buf.get_f32_le();
8468 __struct.rec_top_y = buf.get_f32_le();
8469 __struct.rec_bottom_x = buf.get_f32_le();
8470 __struct.rec_bottom_y = buf.get_f32_le();
8471 let tmp = buf.get_u8();
8472 __struct.tracking_status =
8473 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8474 enum_type: "CameraTrackingStatusFlags",
8475 value: tmp as u32,
8476 })?;
8477 let tmp = buf.get_u8();
8478 __struct.tracking_mode =
8479 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8480 enum_type: "CameraTrackingMode",
8481 value: tmp as u32,
8482 })?;
8483 let tmp = buf.get_u8();
8484 __struct.target_data =
8485 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
8486 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8487 flag_type: "CameraTrackingTargetData",
8488 value: tmp as u32,
8489 })?;
8490 __struct.camera_device_id = buf.get_u8();
8491 Ok(__struct)
8492 }
8493 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8494 let mut __tmp = BytesMut::new(bytes);
8495 #[allow(clippy::absurd_extreme_comparisons)]
8496 #[allow(unused_comparisons)]
8497 if __tmp.remaining() < Self::ENCODED_LEN {
8498 panic!(
8499 "buffer is too small (need {} bytes, but got {})",
8500 Self::ENCODED_LEN,
8501 __tmp.remaining(),
8502 )
8503 }
8504 __tmp.put_f32_le(self.point_x);
8505 __tmp.put_f32_le(self.point_y);
8506 __tmp.put_f32_le(self.radius);
8507 __tmp.put_f32_le(self.rec_top_x);
8508 __tmp.put_f32_le(self.rec_top_y);
8509 __tmp.put_f32_le(self.rec_bottom_x);
8510 __tmp.put_f32_le(self.rec_bottom_y);
8511 __tmp.put_u8(self.tracking_status as u8);
8512 __tmp.put_u8(self.tracking_mode as u8);
8513 __tmp.put_u8(self.target_data.bits());
8514 if matches!(version, MavlinkVersion::V2) {
8515 __tmp.put_u8(self.camera_device_id);
8516 let len = __tmp.len();
8517 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8518 } else {
8519 __tmp.len()
8520 }
8521 }
8522}
8523#[doc = "Camera-IMU triggering and synchronisation message."]
8524#[doc = ""]
8525#[doc = "ID: 112"]
8526#[derive(Debug, Clone, PartialEq)]
8527#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8528#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8529pub struct CAMERA_TRIGGER_DATA {
8530 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8531 pub time_usec: u64,
8532 #[doc = "Image frame sequence"]
8533 pub seq: u32,
8534}
8535impl CAMERA_TRIGGER_DATA {
8536 pub const ENCODED_LEN: usize = 12usize;
8537 pub const DEFAULT: Self = Self {
8538 time_usec: 0_u64,
8539 seq: 0_u32,
8540 };
8541 #[cfg(feature = "arbitrary")]
8542 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8543 use arbitrary::{Arbitrary, Unstructured};
8544 let mut buf = [0u8; 1024];
8545 rng.fill_bytes(&mut buf);
8546 let mut unstructured = Unstructured::new(&buf);
8547 Self::arbitrary(&mut unstructured).unwrap_or_default()
8548 }
8549}
8550impl Default for CAMERA_TRIGGER_DATA {
8551 fn default() -> Self {
8552 Self::DEFAULT.clone()
8553 }
8554}
8555impl MessageData for CAMERA_TRIGGER_DATA {
8556 type Message = MavMessage;
8557 const ID: u32 = 112u32;
8558 const NAME: &'static str = "CAMERA_TRIGGER";
8559 const EXTRA_CRC: u8 = 174u8;
8560 const ENCODED_LEN: usize = 12usize;
8561 fn deser(
8562 _version: MavlinkVersion,
8563 __input: &[u8],
8564 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8565 let avail_len = __input.len();
8566 let mut payload_buf = [0; Self::ENCODED_LEN];
8567 let mut buf = if avail_len < Self::ENCODED_LEN {
8568 payload_buf[0..avail_len].copy_from_slice(__input);
8569 Bytes::new(&payload_buf)
8570 } else {
8571 Bytes::new(__input)
8572 };
8573 let mut __struct = Self::default();
8574 __struct.time_usec = buf.get_u64_le();
8575 __struct.seq = buf.get_u32_le();
8576 Ok(__struct)
8577 }
8578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8579 let mut __tmp = BytesMut::new(bytes);
8580 #[allow(clippy::absurd_extreme_comparisons)]
8581 #[allow(unused_comparisons)]
8582 if __tmp.remaining() < Self::ENCODED_LEN {
8583 panic!(
8584 "buffer is too small (need {} bytes, but got {})",
8585 Self::ENCODED_LEN,
8586 __tmp.remaining(),
8587 )
8588 }
8589 __tmp.put_u64_le(self.time_usec);
8590 __tmp.put_u32_le(self.seq);
8591 if matches!(version, MavlinkVersion::V2) {
8592 let len = __tmp.len();
8593 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8594 } else {
8595 __tmp.len()
8596 }
8597 }
8598}
8599#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8600#[doc = ""]
8601#[doc = "ID: 387"]
8602#[derive(Debug, Clone, PartialEq)]
8603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8605pub struct CANFD_FRAME_DATA {
8606 #[doc = "Frame ID"]
8607 pub id: u32,
8608 #[doc = "System ID."]
8609 pub target_system: u8,
8610 #[doc = "Component ID."]
8611 pub target_component: u8,
8612 #[doc = "bus number"]
8613 pub bus: u8,
8614 #[doc = "Frame length"]
8615 pub len: u8,
8616 #[doc = "Frame data"]
8617 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8618 pub data: [u8; 64],
8619}
8620impl CANFD_FRAME_DATA {
8621 pub const ENCODED_LEN: usize = 72usize;
8622 pub const DEFAULT: Self = Self {
8623 id: 0_u32,
8624 target_system: 0_u8,
8625 target_component: 0_u8,
8626 bus: 0_u8,
8627 len: 0_u8,
8628 data: [0_u8; 64usize],
8629 };
8630 #[cfg(feature = "arbitrary")]
8631 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8632 use arbitrary::{Arbitrary, Unstructured};
8633 let mut buf = [0u8; 1024];
8634 rng.fill_bytes(&mut buf);
8635 let mut unstructured = Unstructured::new(&buf);
8636 Self::arbitrary(&mut unstructured).unwrap_or_default()
8637 }
8638}
8639impl Default for CANFD_FRAME_DATA {
8640 fn default() -> Self {
8641 Self::DEFAULT.clone()
8642 }
8643}
8644impl MessageData for CANFD_FRAME_DATA {
8645 type Message = MavMessage;
8646 const ID: u32 = 387u32;
8647 const NAME: &'static str = "CANFD_FRAME";
8648 const EXTRA_CRC: u8 = 4u8;
8649 const ENCODED_LEN: usize = 72usize;
8650 fn deser(
8651 _version: MavlinkVersion,
8652 __input: &[u8],
8653 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8654 let avail_len = __input.len();
8655 let mut payload_buf = [0; Self::ENCODED_LEN];
8656 let mut buf = if avail_len < Self::ENCODED_LEN {
8657 payload_buf[0..avail_len].copy_from_slice(__input);
8658 Bytes::new(&payload_buf)
8659 } else {
8660 Bytes::new(__input)
8661 };
8662 let mut __struct = Self::default();
8663 __struct.id = buf.get_u32_le();
8664 __struct.target_system = buf.get_u8();
8665 __struct.target_component = buf.get_u8();
8666 __struct.bus = buf.get_u8();
8667 __struct.len = buf.get_u8();
8668 for v in &mut __struct.data {
8669 let val = buf.get_u8();
8670 *v = val;
8671 }
8672 Ok(__struct)
8673 }
8674 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8675 let mut __tmp = BytesMut::new(bytes);
8676 #[allow(clippy::absurd_extreme_comparisons)]
8677 #[allow(unused_comparisons)]
8678 if __tmp.remaining() < Self::ENCODED_LEN {
8679 panic!(
8680 "buffer is too small (need {} bytes, but got {})",
8681 Self::ENCODED_LEN,
8682 __tmp.remaining(),
8683 )
8684 }
8685 __tmp.put_u32_le(self.id);
8686 __tmp.put_u8(self.target_system);
8687 __tmp.put_u8(self.target_component);
8688 __tmp.put_u8(self.bus);
8689 __tmp.put_u8(self.len);
8690 for val in &self.data {
8691 __tmp.put_u8(*val);
8692 }
8693 if matches!(version, MavlinkVersion::V2) {
8694 let len = __tmp.len();
8695 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8696 } else {
8697 __tmp.len()
8698 }
8699 }
8700}
8701#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8702#[doc = ""]
8703#[doc = "ID: 388"]
8704#[derive(Debug, Clone, PartialEq)]
8705#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8706#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8707pub struct CAN_FILTER_MODIFY_DATA {
8708 #[doc = "filter IDs, length num_ids"]
8709 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8710 pub ids: [u16; 16],
8711 #[doc = "System ID."]
8712 pub target_system: u8,
8713 #[doc = "Component ID."]
8714 pub target_component: u8,
8715 #[doc = "bus number"]
8716 pub bus: u8,
8717 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8718 pub operation: CanFilterOp,
8719 #[doc = "number of IDs in filter list"]
8720 pub num_ids: u8,
8721}
8722impl CAN_FILTER_MODIFY_DATA {
8723 pub const ENCODED_LEN: usize = 37usize;
8724 pub const DEFAULT: Self = Self {
8725 ids: [0_u16; 16usize],
8726 target_system: 0_u8,
8727 target_component: 0_u8,
8728 bus: 0_u8,
8729 operation: CanFilterOp::DEFAULT,
8730 num_ids: 0_u8,
8731 };
8732 #[cfg(feature = "arbitrary")]
8733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8734 use arbitrary::{Arbitrary, Unstructured};
8735 let mut buf = [0u8; 1024];
8736 rng.fill_bytes(&mut buf);
8737 let mut unstructured = Unstructured::new(&buf);
8738 Self::arbitrary(&mut unstructured).unwrap_or_default()
8739 }
8740}
8741impl Default for CAN_FILTER_MODIFY_DATA {
8742 fn default() -> Self {
8743 Self::DEFAULT.clone()
8744 }
8745}
8746impl MessageData for CAN_FILTER_MODIFY_DATA {
8747 type Message = MavMessage;
8748 const ID: u32 = 388u32;
8749 const NAME: &'static str = "CAN_FILTER_MODIFY";
8750 const EXTRA_CRC: u8 = 8u8;
8751 const ENCODED_LEN: usize = 37usize;
8752 fn deser(
8753 _version: MavlinkVersion,
8754 __input: &[u8],
8755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8756 let avail_len = __input.len();
8757 let mut payload_buf = [0; Self::ENCODED_LEN];
8758 let mut buf = if avail_len < Self::ENCODED_LEN {
8759 payload_buf[0..avail_len].copy_from_slice(__input);
8760 Bytes::new(&payload_buf)
8761 } else {
8762 Bytes::new(__input)
8763 };
8764 let mut __struct = Self::default();
8765 for v in &mut __struct.ids {
8766 let val = buf.get_u16_le();
8767 *v = val;
8768 }
8769 __struct.target_system = buf.get_u8();
8770 __struct.target_component = buf.get_u8();
8771 __struct.bus = buf.get_u8();
8772 let tmp = buf.get_u8();
8773 __struct.operation =
8774 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8775 enum_type: "CanFilterOp",
8776 value: tmp as u32,
8777 })?;
8778 __struct.num_ids = buf.get_u8();
8779 Ok(__struct)
8780 }
8781 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8782 let mut __tmp = BytesMut::new(bytes);
8783 #[allow(clippy::absurd_extreme_comparisons)]
8784 #[allow(unused_comparisons)]
8785 if __tmp.remaining() < Self::ENCODED_LEN {
8786 panic!(
8787 "buffer is too small (need {} bytes, but got {})",
8788 Self::ENCODED_LEN,
8789 __tmp.remaining(),
8790 )
8791 }
8792 for val in &self.ids {
8793 __tmp.put_u16_le(*val);
8794 }
8795 __tmp.put_u8(self.target_system);
8796 __tmp.put_u8(self.target_component);
8797 __tmp.put_u8(self.bus);
8798 __tmp.put_u8(self.operation as u8);
8799 __tmp.put_u8(self.num_ids);
8800 if matches!(version, MavlinkVersion::V2) {
8801 let len = __tmp.len();
8802 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8803 } else {
8804 __tmp.len()
8805 }
8806 }
8807}
8808#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8809#[doc = ""]
8810#[doc = "ID: 386"]
8811#[derive(Debug, Clone, PartialEq)]
8812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8814pub struct CAN_FRAME_DATA {
8815 #[doc = "Frame ID"]
8816 pub id: u32,
8817 #[doc = "System ID."]
8818 pub target_system: u8,
8819 #[doc = "Component ID."]
8820 pub target_component: u8,
8821 #[doc = "Bus number"]
8822 pub bus: u8,
8823 #[doc = "Frame length"]
8824 pub len: u8,
8825 #[doc = "Frame data"]
8826 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8827 pub data: [u8; 8],
8828}
8829impl CAN_FRAME_DATA {
8830 pub const ENCODED_LEN: usize = 16usize;
8831 pub const DEFAULT: Self = Self {
8832 id: 0_u32,
8833 target_system: 0_u8,
8834 target_component: 0_u8,
8835 bus: 0_u8,
8836 len: 0_u8,
8837 data: [0_u8; 8usize],
8838 };
8839 #[cfg(feature = "arbitrary")]
8840 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8841 use arbitrary::{Arbitrary, Unstructured};
8842 let mut buf = [0u8; 1024];
8843 rng.fill_bytes(&mut buf);
8844 let mut unstructured = Unstructured::new(&buf);
8845 Self::arbitrary(&mut unstructured).unwrap_or_default()
8846 }
8847}
8848impl Default for CAN_FRAME_DATA {
8849 fn default() -> Self {
8850 Self::DEFAULT.clone()
8851 }
8852}
8853impl MessageData for CAN_FRAME_DATA {
8854 type Message = MavMessage;
8855 const ID: u32 = 386u32;
8856 const NAME: &'static str = "CAN_FRAME";
8857 const EXTRA_CRC: u8 = 132u8;
8858 const ENCODED_LEN: usize = 16usize;
8859 fn deser(
8860 _version: MavlinkVersion,
8861 __input: &[u8],
8862 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8863 let avail_len = __input.len();
8864 let mut payload_buf = [0; Self::ENCODED_LEN];
8865 let mut buf = if avail_len < Self::ENCODED_LEN {
8866 payload_buf[0..avail_len].copy_from_slice(__input);
8867 Bytes::new(&payload_buf)
8868 } else {
8869 Bytes::new(__input)
8870 };
8871 let mut __struct = Self::default();
8872 __struct.id = buf.get_u32_le();
8873 __struct.target_system = buf.get_u8();
8874 __struct.target_component = buf.get_u8();
8875 __struct.bus = buf.get_u8();
8876 __struct.len = buf.get_u8();
8877 for v in &mut __struct.data {
8878 let val = buf.get_u8();
8879 *v = val;
8880 }
8881 Ok(__struct)
8882 }
8883 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8884 let mut __tmp = BytesMut::new(bytes);
8885 #[allow(clippy::absurd_extreme_comparisons)]
8886 #[allow(unused_comparisons)]
8887 if __tmp.remaining() < Self::ENCODED_LEN {
8888 panic!(
8889 "buffer is too small (need {} bytes, but got {})",
8890 Self::ENCODED_LEN,
8891 __tmp.remaining(),
8892 )
8893 }
8894 __tmp.put_u32_le(self.id);
8895 __tmp.put_u8(self.target_system);
8896 __tmp.put_u8(self.target_component);
8897 __tmp.put_u8(self.bus);
8898 __tmp.put_u8(self.len);
8899 for val in &self.data {
8900 __tmp.put_u8(*val);
8901 }
8902 if matches!(version, MavlinkVersion::V2) {
8903 let len = __tmp.len();
8904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8905 } else {
8906 __tmp.len()
8907 }
8908 }
8909}
8910#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8911#[doc = ""]
8912#[doc = "ID: 336"]
8913#[derive(Debug, Clone, PartialEq)]
8914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8916pub struct CELLULAR_CONFIG_DATA {
8917 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8918 pub enable_lte: u8,
8919 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8920 pub enable_pin: u8,
8921 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8922 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8923 pub pin: [u8; 16],
8924 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8925 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8926 pub new_pin: [u8; 16],
8927 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8928 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8929 pub apn: [u8; 32],
8930 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8931 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8932 pub puk: [u8; 16],
8933 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8934 pub roaming: u8,
8935 #[doc = "Message acceptance response (sent back to GS)."]
8936 pub response: CellularConfigResponse,
8937}
8938impl CELLULAR_CONFIG_DATA {
8939 pub const ENCODED_LEN: usize = 84usize;
8940 pub const DEFAULT: Self = Self {
8941 enable_lte: 0_u8,
8942 enable_pin: 0_u8,
8943 pin: [0_u8; 16usize],
8944 new_pin: [0_u8; 16usize],
8945 apn: [0_u8; 32usize],
8946 puk: [0_u8; 16usize],
8947 roaming: 0_u8,
8948 response: CellularConfigResponse::DEFAULT,
8949 };
8950 #[cfg(feature = "arbitrary")]
8951 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8952 use arbitrary::{Arbitrary, Unstructured};
8953 let mut buf = [0u8; 1024];
8954 rng.fill_bytes(&mut buf);
8955 let mut unstructured = Unstructured::new(&buf);
8956 Self::arbitrary(&mut unstructured).unwrap_or_default()
8957 }
8958}
8959impl Default for CELLULAR_CONFIG_DATA {
8960 fn default() -> Self {
8961 Self::DEFAULT.clone()
8962 }
8963}
8964impl MessageData for CELLULAR_CONFIG_DATA {
8965 type Message = MavMessage;
8966 const ID: u32 = 336u32;
8967 const NAME: &'static str = "CELLULAR_CONFIG";
8968 const EXTRA_CRC: u8 = 245u8;
8969 const ENCODED_LEN: usize = 84usize;
8970 fn deser(
8971 _version: MavlinkVersion,
8972 __input: &[u8],
8973 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8974 let avail_len = __input.len();
8975 let mut payload_buf = [0; Self::ENCODED_LEN];
8976 let mut buf = if avail_len < Self::ENCODED_LEN {
8977 payload_buf[0..avail_len].copy_from_slice(__input);
8978 Bytes::new(&payload_buf)
8979 } else {
8980 Bytes::new(__input)
8981 };
8982 let mut __struct = Self::default();
8983 __struct.enable_lte = buf.get_u8();
8984 __struct.enable_pin = buf.get_u8();
8985 for v in &mut __struct.pin {
8986 let val = buf.get_u8();
8987 *v = val;
8988 }
8989 for v in &mut __struct.new_pin {
8990 let val = buf.get_u8();
8991 *v = val;
8992 }
8993 for v in &mut __struct.apn {
8994 let val = buf.get_u8();
8995 *v = val;
8996 }
8997 for v in &mut __struct.puk {
8998 let val = buf.get_u8();
8999 *v = val;
9000 }
9001 __struct.roaming = buf.get_u8();
9002 let tmp = buf.get_u8();
9003 __struct.response =
9004 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9005 enum_type: "CellularConfigResponse",
9006 value: tmp as u32,
9007 })?;
9008 Ok(__struct)
9009 }
9010 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9011 let mut __tmp = BytesMut::new(bytes);
9012 #[allow(clippy::absurd_extreme_comparisons)]
9013 #[allow(unused_comparisons)]
9014 if __tmp.remaining() < Self::ENCODED_LEN {
9015 panic!(
9016 "buffer is too small (need {} bytes, but got {})",
9017 Self::ENCODED_LEN,
9018 __tmp.remaining(),
9019 )
9020 }
9021 __tmp.put_u8(self.enable_lte);
9022 __tmp.put_u8(self.enable_pin);
9023 for val in &self.pin {
9024 __tmp.put_u8(*val);
9025 }
9026 for val in &self.new_pin {
9027 __tmp.put_u8(*val);
9028 }
9029 for val in &self.apn {
9030 __tmp.put_u8(*val);
9031 }
9032 for val in &self.puk {
9033 __tmp.put_u8(*val);
9034 }
9035 __tmp.put_u8(self.roaming);
9036 __tmp.put_u8(self.response as u8);
9037 if matches!(version, MavlinkVersion::V2) {
9038 let len = __tmp.len();
9039 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9040 } else {
9041 __tmp.len()
9042 }
9043 }
9044}
9045#[doc = "Report current used cellular network status."]
9046#[doc = ""]
9047#[doc = "ID: 334"]
9048#[derive(Debug, Clone, PartialEq)]
9049#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9050#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9051pub struct CELLULAR_STATUS_DATA {
9052 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
9053 pub mcc: u16,
9054 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
9055 pub mnc: u16,
9056 #[doc = "Location area code. If unknown, set to 0"]
9057 pub lac: u16,
9058 #[doc = "Cellular modem status"]
9059 pub status: CellularStatusFlag,
9060 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
9061 pub failure_reason: CellularNetworkFailedReason,
9062 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
9063 pub mavtype: CellularNetworkRadioType,
9064 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
9065 pub quality: u8,
9066}
9067impl CELLULAR_STATUS_DATA {
9068 pub const ENCODED_LEN: usize = 10usize;
9069 pub const DEFAULT: Self = Self {
9070 mcc: 0_u16,
9071 mnc: 0_u16,
9072 lac: 0_u16,
9073 status: CellularStatusFlag::DEFAULT,
9074 failure_reason: CellularNetworkFailedReason::DEFAULT,
9075 mavtype: CellularNetworkRadioType::DEFAULT,
9076 quality: 0_u8,
9077 };
9078 #[cfg(feature = "arbitrary")]
9079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9080 use arbitrary::{Arbitrary, Unstructured};
9081 let mut buf = [0u8; 1024];
9082 rng.fill_bytes(&mut buf);
9083 let mut unstructured = Unstructured::new(&buf);
9084 Self::arbitrary(&mut unstructured).unwrap_or_default()
9085 }
9086}
9087impl Default for CELLULAR_STATUS_DATA {
9088 fn default() -> Self {
9089 Self::DEFAULT.clone()
9090 }
9091}
9092impl MessageData for CELLULAR_STATUS_DATA {
9093 type Message = MavMessage;
9094 const ID: u32 = 334u32;
9095 const NAME: &'static str = "CELLULAR_STATUS";
9096 const EXTRA_CRC: u8 = 72u8;
9097 const ENCODED_LEN: usize = 10usize;
9098 fn deser(
9099 _version: MavlinkVersion,
9100 __input: &[u8],
9101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9102 let avail_len = __input.len();
9103 let mut payload_buf = [0; Self::ENCODED_LEN];
9104 let mut buf = if avail_len < Self::ENCODED_LEN {
9105 payload_buf[0..avail_len].copy_from_slice(__input);
9106 Bytes::new(&payload_buf)
9107 } else {
9108 Bytes::new(__input)
9109 };
9110 let mut __struct = Self::default();
9111 __struct.mcc = buf.get_u16_le();
9112 __struct.mnc = buf.get_u16_le();
9113 __struct.lac = buf.get_u16_le();
9114 let tmp = buf.get_u8();
9115 __struct.status =
9116 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9117 enum_type: "CellularStatusFlag",
9118 value: tmp as u32,
9119 })?;
9120 let tmp = buf.get_u8();
9121 __struct.failure_reason =
9122 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9123 enum_type: "CellularNetworkFailedReason",
9124 value: tmp as u32,
9125 })?;
9126 let tmp = buf.get_u8();
9127 __struct.mavtype =
9128 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9129 enum_type: "CellularNetworkRadioType",
9130 value: tmp as u32,
9131 })?;
9132 __struct.quality = buf.get_u8();
9133 Ok(__struct)
9134 }
9135 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9136 let mut __tmp = BytesMut::new(bytes);
9137 #[allow(clippy::absurd_extreme_comparisons)]
9138 #[allow(unused_comparisons)]
9139 if __tmp.remaining() < Self::ENCODED_LEN {
9140 panic!(
9141 "buffer is too small (need {} bytes, but got {})",
9142 Self::ENCODED_LEN,
9143 __tmp.remaining(),
9144 )
9145 }
9146 __tmp.put_u16_le(self.mcc);
9147 __tmp.put_u16_le(self.mnc);
9148 __tmp.put_u16_le(self.lac);
9149 __tmp.put_u8(self.status as u8);
9150 __tmp.put_u8(self.failure_reason as u8);
9151 __tmp.put_u8(self.mavtype as u8);
9152 __tmp.put_u8(self.quality);
9153 if matches!(version, MavlinkVersion::V2) {
9154 let len = __tmp.len();
9155 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9156 } else {
9157 __tmp.len()
9158 }
9159 }
9160}
9161#[doc = "Request to control this MAV."]
9162#[doc = ""]
9163#[doc = "ID: 5"]
9164#[derive(Debug, Clone, PartialEq)]
9165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9167pub struct CHANGE_OPERATOR_CONTROL_DATA {
9168 #[doc = "System the GCS requests control for"]
9169 pub target_system: u8,
9170 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9171 pub control_request: u8,
9172 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
9173 pub version: u8,
9174 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
9175 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9176 pub passkey: [u8; 25],
9177}
9178impl CHANGE_OPERATOR_CONTROL_DATA {
9179 pub const ENCODED_LEN: usize = 28usize;
9180 pub const DEFAULT: Self = Self {
9181 target_system: 0_u8,
9182 control_request: 0_u8,
9183 version: 0_u8,
9184 passkey: [0_u8; 25usize],
9185 };
9186 #[cfg(feature = "arbitrary")]
9187 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9188 use arbitrary::{Arbitrary, Unstructured};
9189 let mut buf = [0u8; 1024];
9190 rng.fill_bytes(&mut buf);
9191 let mut unstructured = Unstructured::new(&buf);
9192 Self::arbitrary(&mut unstructured).unwrap_or_default()
9193 }
9194}
9195impl Default for CHANGE_OPERATOR_CONTROL_DATA {
9196 fn default() -> Self {
9197 Self::DEFAULT.clone()
9198 }
9199}
9200impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
9201 type Message = MavMessage;
9202 const ID: u32 = 5u32;
9203 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
9204 const EXTRA_CRC: u8 = 217u8;
9205 const ENCODED_LEN: usize = 28usize;
9206 fn deser(
9207 _version: MavlinkVersion,
9208 __input: &[u8],
9209 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9210 let avail_len = __input.len();
9211 let mut payload_buf = [0; Self::ENCODED_LEN];
9212 let mut buf = if avail_len < Self::ENCODED_LEN {
9213 payload_buf[0..avail_len].copy_from_slice(__input);
9214 Bytes::new(&payload_buf)
9215 } else {
9216 Bytes::new(__input)
9217 };
9218 let mut __struct = Self::default();
9219 __struct.target_system = buf.get_u8();
9220 __struct.control_request = buf.get_u8();
9221 __struct.version = buf.get_u8();
9222 for v in &mut __struct.passkey {
9223 let val = buf.get_u8();
9224 *v = val;
9225 }
9226 Ok(__struct)
9227 }
9228 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9229 let mut __tmp = BytesMut::new(bytes);
9230 #[allow(clippy::absurd_extreme_comparisons)]
9231 #[allow(unused_comparisons)]
9232 if __tmp.remaining() < Self::ENCODED_LEN {
9233 panic!(
9234 "buffer is too small (need {} bytes, but got {})",
9235 Self::ENCODED_LEN,
9236 __tmp.remaining(),
9237 )
9238 }
9239 __tmp.put_u8(self.target_system);
9240 __tmp.put_u8(self.control_request);
9241 __tmp.put_u8(self.version);
9242 for val in &self.passkey {
9243 __tmp.put_u8(*val);
9244 }
9245 if matches!(version, MavlinkVersion::V2) {
9246 let len = __tmp.len();
9247 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9248 } else {
9249 __tmp.len()
9250 }
9251 }
9252}
9253#[doc = "Accept / deny control of this MAV."]
9254#[doc = ""]
9255#[doc = "ID: 6"]
9256#[derive(Debug, Clone, PartialEq)]
9257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9258#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9259pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
9260 #[doc = "ID of the GCS this message"]
9261 pub gcs_system_id: u8,
9262 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9263 pub control_request: u8,
9264 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
9265 pub ack: u8,
9266}
9267impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
9268 pub const ENCODED_LEN: usize = 3usize;
9269 pub const DEFAULT: Self = Self {
9270 gcs_system_id: 0_u8,
9271 control_request: 0_u8,
9272 ack: 0_u8,
9273 };
9274 #[cfg(feature = "arbitrary")]
9275 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9276 use arbitrary::{Arbitrary, Unstructured};
9277 let mut buf = [0u8; 1024];
9278 rng.fill_bytes(&mut buf);
9279 let mut unstructured = Unstructured::new(&buf);
9280 Self::arbitrary(&mut unstructured).unwrap_or_default()
9281 }
9282}
9283impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9284 fn default() -> Self {
9285 Self::DEFAULT.clone()
9286 }
9287}
9288impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9289 type Message = MavMessage;
9290 const ID: u32 = 6u32;
9291 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
9292 const EXTRA_CRC: u8 = 104u8;
9293 const ENCODED_LEN: usize = 3usize;
9294 fn deser(
9295 _version: MavlinkVersion,
9296 __input: &[u8],
9297 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9298 let avail_len = __input.len();
9299 let mut payload_buf = [0; Self::ENCODED_LEN];
9300 let mut buf = if avail_len < Self::ENCODED_LEN {
9301 payload_buf[0..avail_len].copy_from_slice(__input);
9302 Bytes::new(&payload_buf)
9303 } else {
9304 Bytes::new(__input)
9305 };
9306 let mut __struct = Self::default();
9307 __struct.gcs_system_id = buf.get_u8();
9308 __struct.control_request = buf.get_u8();
9309 __struct.ack = buf.get_u8();
9310 Ok(__struct)
9311 }
9312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9313 let mut __tmp = BytesMut::new(bytes);
9314 #[allow(clippy::absurd_extreme_comparisons)]
9315 #[allow(unused_comparisons)]
9316 if __tmp.remaining() < Self::ENCODED_LEN {
9317 panic!(
9318 "buffer is too small (need {} bytes, but got {})",
9319 Self::ENCODED_LEN,
9320 __tmp.remaining(),
9321 )
9322 }
9323 __tmp.put_u8(self.gcs_system_id);
9324 __tmp.put_u8(self.control_request);
9325 __tmp.put_u8(self.ack);
9326 if matches!(version, MavlinkVersion::V2) {
9327 let len = __tmp.len();
9328 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9329 } else {
9330 __tmp.len()
9331 }
9332 }
9333}
9334#[doc = "Information about a potential collision."]
9335#[doc = ""]
9336#[doc = "ID: 247"]
9337#[derive(Debug, Clone, PartialEq)]
9338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9340pub struct COLLISION_DATA {
9341 #[doc = "Unique identifier, domain based on src field"]
9342 pub id: u32,
9343 #[doc = "Estimated time until collision occurs"]
9344 pub time_to_minimum_delta: f32,
9345 #[doc = "Closest vertical distance between vehicle and object"]
9346 pub altitude_minimum_delta: f32,
9347 #[doc = "Closest horizontal distance between vehicle and object"]
9348 pub horizontal_minimum_delta: f32,
9349 #[doc = "Collision data source"]
9350 pub src: MavCollisionSrc,
9351 #[doc = "Action that is being taken to avoid this collision"]
9352 pub action: MavCollisionAction,
9353 #[doc = "How concerned the aircraft is about this collision"]
9354 pub threat_level: MavCollisionThreatLevel,
9355}
9356impl COLLISION_DATA {
9357 pub const ENCODED_LEN: usize = 19usize;
9358 pub const DEFAULT: Self = Self {
9359 id: 0_u32,
9360 time_to_minimum_delta: 0.0_f32,
9361 altitude_minimum_delta: 0.0_f32,
9362 horizontal_minimum_delta: 0.0_f32,
9363 src: MavCollisionSrc::DEFAULT,
9364 action: MavCollisionAction::DEFAULT,
9365 threat_level: MavCollisionThreatLevel::DEFAULT,
9366 };
9367 #[cfg(feature = "arbitrary")]
9368 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9369 use arbitrary::{Arbitrary, Unstructured};
9370 let mut buf = [0u8; 1024];
9371 rng.fill_bytes(&mut buf);
9372 let mut unstructured = Unstructured::new(&buf);
9373 Self::arbitrary(&mut unstructured).unwrap_or_default()
9374 }
9375}
9376impl Default for COLLISION_DATA {
9377 fn default() -> Self {
9378 Self::DEFAULT.clone()
9379 }
9380}
9381impl MessageData for COLLISION_DATA {
9382 type Message = MavMessage;
9383 const ID: u32 = 247u32;
9384 const NAME: &'static str = "COLLISION";
9385 const EXTRA_CRC: u8 = 81u8;
9386 const ENCODED_LEN: usize = 19usize;
9387 fn deser(
9388 _version: MavlinkVersion,
9389 __input: &[u8],
9390 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9391 let avail_len = __input.len();
9392 let mut payload_buf = [0; Self::ENCODED_LEN];
9393 let mut buf = if avail_len < Self::ENCODED_LEN {
9394 payload_buf[0..avail_len].copy_from_slice(__input);
9395 Bytes::new(&payload_buf)
9396 } else {
9397 Bytes::new(__input)
9398 };
9399 let mut __struct = Self::default();
9400 __struct.id = buf.get_u32_le();
9401 __struct.time_to_minimum_delta = buf.get_f32_le();
9402 __struct.altitude_minimum_delta = buf.get_f32_le();
9403 __struct.horizontal_minimum_delta = buf.get_f32_le();
9404 let tmp = buf.get_u8();
9405 __struct.src =
9406 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9407 enum_type: "MavCollisionSrc",
9408 value: tmp as u32,
9409 })?;
9410 let tmp = buf.get_u8();
9411 __struct.action =
9412 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9413 enum_type: "MavCollisionAction",
9414 value: tmp as u32,
9415 })?;
9416 let tmp = buf.get_u8();
9417 __struct.threat_level =
9418 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9419 enum_type: "MavCollisionThreatLevel",
9420 value: tmp as u32,
9421 })?;
9422 Ok(__struct)
9423 }
9424 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9425 let mut __tmp = BytesMut::new(bytes);
9426 #[allow(clippy::absurd_extreme_comparisons)]
9427 #[allow(unused_comparisons)]
9428 if __tmp.remaining() < Self::ENCODED_LEN {
9429 panic!(
9430 "buffer is too small (need {} bytes, but got {})",
9431 Self::ENCODED_LEN,
9432 __tmp.remaining(),
9433 )
9434 }
9435 __tmp.put_u32_le(self.id);
9436 __tmp.put_f32_le(self.time_to_minimum_delta);
9437 __tmp.put_f32_le(self.altitude_minimum_delta);
9438 __tmp.put_f32_le(self.horizontal_minimum_delta);
9439 __tmp.put_u8(self.src as u8);
9440 __tmp.put_u8(self.action as u8);
9441 __tmp.put_u8(self.threat_level as u8);
9442 if matches!(version, MavlinkVersion::V2) {
9443 let len = __tmp.len();
9444 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9445 } else {
9446 __tmp.len()
9447 }
9448 }
9449}
9450#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9451#[doc = ""]
9452#[doc = "ID: 77"]
9453#[derive(Debug, Clone, PartialEq)]
9454#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9455#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9456pub struct COMMAND_ACK_DATA {
9457 #[doc = "Command ID (of acknowledged command)."]
9458 pub command: MavCmd,
9459 #[doc = "Result of command."]
9460 pub result: MavResult,
9461 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9462 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9463 pub progress: u8,
9464 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9465 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9466 pub result_param2: i32,
9467 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9468 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9469 pub target_system: u8,
9470 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9471 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9472 pub target_component: u8,
9473}
9474impl COMMAND_ACK_DATA {
9475 pub const ENCODED_LEN: usize = 10usize;
9476 pub const DEFAULT: Self = Self {
9477 command: MavCmd::DEFAULT,
9478 result: MavResult::DEFAULT,
9479 progress: 0_u8,
9480 result_param2: 0_i32,
9481 target_system: 0_u8,
9482 target_component: 0_u8,
9483 };
9484 #[cfg(feature = "arbitrary")]
9485 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9486 use arbitrary::{Arbitrary, Unstructured};
9487 let mut buf = [0u8; 1024];
9488 rng.fill_bytes(&mut buf);
9489 let mut unstructured = Unstructured::new(&buf);
9490 Self::arbitrary(&mut unstructured).unwrap_or_default()
9491 }
9492}
9493impl Default for COMMAND_ACK_DATA {
9494 fn default() -> Self {
9495 Self::DEFAULT.clone()
9496 }
9497}
9498impl MessageData for COMMAND_ACK_DATA {
9499 type Message = MavMessage;
9500 const ID: u32 = 77u32;
9501 const NAME: &'static str = "COMMAND_ACK";
9502 const EXTRA_CRC: u8 = 143u8;
9503 const ENCODED_LEN: usize = 10usize;
9504 fn deser(
9505 _version: MavlinkVersion,
9506 __input: &[u8],
9507 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9508 let avail_len = __input.len();
9509 let mut payload_buf = [0; Self::ENCODED_LEN];
9510 let mut buf = if avail_len < Self::ENCODED_LEN {
9511 payload_buf[0..avail_len].copy_from_slice(__input);
9512 Bytes::new(&payload_buf)
9513 } else {
9514 Bytes::new(__input)
9515 };
9516 let mut __struct = Self::default();
9517 let tmp = buf.get_u16_le();
9518 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9519 ::mavlink_core::error::ParserError::InvalidEnum {
9520 enum_type: "MavCmd",
9521 value: tmp as u32,
9522 },
9523 )?;
9524 let tmp = buf.get_u8();
9525 __struct.result =
9526 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9527 enum_type: "MavResult",
9528 value: tmp as u32,
9529 })?;
9530 __struct.progress = buf.get_u8();
9531 __struct.result_param2 = buf.get_i32_le();
9532 __struct.target_system = buf.get_u8();
9533 __struct.target_component = buf.get_u8();
9534 Ok(__struct)
9535 }
9536 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9537 let mut __tmp = BytesMut::new(bytes);
9538 #[allow(clippy::absurd_extreme_comparisons)]
9539 #[allow(unused_comparisons)]
9540 if __tmp.remaining() < Self::ENCODED_LEN {
9541 panic!(
9542 "buffer is too small (need {} bytes, but got {})",
9543 Self::ENCODED_LEN,
9544 __tmp.remaining(),
9545 )
9546 }
9547 __tmp.put_u16_le(self.command as u16);
9548 __tmp.put_u8(self.result as u8);
9549 if matches!(version, MavlinkVersion::V2) {
9550 __tmp.put_u8(self.progress);
9551 __tmp.put_i32_le(self.result_param2);
9552 __tmp.put_u8(self.target_system);
9553 __tmp.put_u8(self.target_component);
9554 let len = __tmp.len();
9555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9556 } else {
9557 __tmp.len()
9558 }
9559 }
9560}
9561#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9562#[doc = ""]
9563#[doc = "ID: 80"]
9564#[derive(Debug, Clone, PartialEq)]
9565#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9567pub struct COMMAND_CANCEL_DATA {
9568 #[doc = "Command ID (of command to cancel)."]
9569 pub command: MavCmd,
9570 #[doc = "System executing long running command. Should not be broadcast (0)."]
9571 pub target_system: u8,
9572 #[doc = "Component executing long running command."]
9573 pub target_component: u8,
9574}
9575impl COMMAND_CANCEL_DATA {
9576 pub const ENCODED_LEN: usize = 4usize;
9577 pub const DEFAULT: Self = Self {
9578 command: MavCmd::DEFAULT,
9579 target_system: 0_u8,
9580 target_component: 0_u8,
9581 };
9582 #[cfg(feature = "arbitrary")]
9583 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9584 use arbitrary::{Arbitrary, Unstructured};
9585 let mut buf = [0u8; 1024];
9586 rng.fill_bytes(&mut buf);
9587 let mut unstructured = Unstructured::new(&buf);
9588 Self::arbitrary(&mut unstructured).unwrap_or_default()
9589 }
9590}
9591impl Default for COMMAND_CANCEL_DATA {
9592 fn default() -> Self {
9593 Self::DEFAULT.clone()
9594 }
9595}
9596impl MessageData for COMMAND_CANCEL_DATA {
9597 type Message = MavMessage;
9598 const ID: u32 = 80u32;
9599 const NAME: &'static str = "COMMAND_CANCEL";
9600 const EXTRA_CRC: u8 = 14u8;
9601 const ENCODED_LEN: usize = 4usize;
9602 fn deser(
9603 _version: MavlinkVersion,
9604 __input: &[u8],
9605 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9606 let avail_len = __input.len();
9607 let mut payload_buf = [0; Self::ENCODED_LEN];
9608 let mut buf = if avail_len < Self::ENCODED_LEN {
9609 payload_buf[0..avail_len].copy_from_slice(__input);
9610 Bytes::new(&payload_buf)
9611 } else {
9612 Bytes::new(__input)
9613 };
9614 let mut __struct = Self::default();
9615 let tmp = buf.get_u16_le();
9616 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9617 ::mavlink_core::error::ParserError::InvalidEnum {
9618 enum_type: "MavCmd",
9619 value: tmp as u32,
9620 },
9621 )?;
9622 __struct.target_system = buf.get_u8();
9623 __struct.target_component = buf.get_u8();
9624 Ok(__struct)
9625 }
9626 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9627 let mut __tmp = BytesMut::new(bytes);
9628 #[allow(clippy::absurd_extreme_comparisons)]
9629 #[allow(unused_comparisons)]
9630 if __tmp.remaining() < Self::ENCODED_LEN {
9631 panic!(
9632 "buffer is too small (need {} bytes, but got {})",
9633 Self::ENCODED_LEN,
9634 __tmp.remaining(),
9635 )
9636 }
9637 __tmp.put_u16_le(self.command as u16);
9638 __tmp.put_u8(self.target_system);
9639 __tmp.put_u8(self.target_component);
9640 if matches!(version, MavlinkVersion::V2) {
9641 let len = __tmp.len();
9642 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9643 } else {
9644 __tmp.len()
9645 }
9646 }
9647}
9648#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9649#[doc = ""]
9650#[doc = "ID: 75"]
9651#[derive(Debug, Clone, PartialEq)]
9652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9654pub struct COMMAND_INT_DATA {
9655 #[doc = "PARAM1, see MAV_CMD enum"]
9656 pub param1: f32,
9657 #[doc = "PARAM2, see MAV_CMD enum"]
9658 pub param2: f32,
9659 #[doc = "PARAM3, see MAV_CMD enum"]
9660 pub param3: f32,
9661 #[doc = "PARAM4, see MAV_CMD enum"]
9662 pub param4: f32,
9663 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9664 pub x: i32,
9665 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9666 pub y: i32,
9667 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9668 pub z: f32,
9669 #[doc = "The scheduled action for the mission item."]
9670 pub command: MavCmd,
9671 #[doc = "System ID"]
9672 pub target_system: u8,
9673 #[doc = "Component ID"]
9674 pub target_component: u8,
9675 #[doc = "The coordinate system of the COMMAND."]
9676 pub frame: MavFrame,
9677 #[doc = "Not used."]
9678 pub current: u8,
9679 #[doc = "Not used (set 0)."]
9680 pub autocontinue: u8,
9681}
9682impl COMMAND_INT_DATA {
9683 pub const ENCODED_LEN: usize = 35usize;
9684 pub const DEFAULT: Self = Self {
9685 param1: 0.0_f32,
9686 param2: 0.0_f32,
9687 param3: 0.0_f32,
9688 param4: 0.0_f32,
9689 x: 0_i32,
9690 y: 0_i32,
9691 z: 0.0_f32,
9692 command: MavCmd::DEFAULT,
9693 target_system: 0_u8,
9694 target_component: 0_u8,
9695 frame: MavFrame::DEFAULT,
9696 current: 0_u8,
9697 autocontinue: 0_u8,
9698 };
9699 #[cfg(feature = "arbitrary")]
9700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9701 use arbitrary::{Arbitrary, Unstructured};
9702 let mut buf = [0u8; 1024];
9703 rng.fill_bytes(&mut buf);
9704 let mut unstructured = Unstructured::new(&buf);
9705 Self::arbitrary(&mut unstructured).unwrap_or_default()
9706 }
9707}
9708impl Default for COMMAND_INT_DATA {
9709 fn default() -> Self {
9710 Self::DEFAULT.clone()
9711 }
9712}
9713impl MessageData for COMMAND_INT_DATA {
9714 type Message = MavMessage;
9715 const ID: u32 = 75u32;
9716 const NAME: &'static str = "COMMAND_INT";
9717 const EXTRA_CRC: u8 = 158u8;
9718 const ENCODED_LEN: usize = 35usize;
9719 fn deser(
9720 _version: MavlinkVersion,
9721 __input: &[u8],
9722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9723 let avail_len = __input.len();
9724 let mut payload_buf = [0; Self::ENCODED_LEN];
9725 let mut buf = if avail_len < Self::ENCODED_LEN {
9726 payload_buf[0..avail_len].copy_from_slice(__input);
9727 Bytes::new(&payload_buf)
9728 } else {
9729 Bytes::new(__input)
9730 };
9731 let mut __struct = Self::default();
9732 __struct.param1 = buf.get_f32_le();
9733 __struct.param2 = buf.get_f32_le();
9734 __struct.param3 = buf.get_f32_le();
9735 __struct.param4 = buf.get_f32_le();
9736 __struct.x = buf.get_i32_le();
9737 __struct.y = buf.get_i32_le();
9738 __struct.z = buf.get_f32_le();
9739 let tmp = buf.get_u16_le();
9740 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9741 ::mavlink_core::error::ParserError::InvalidEnum {
9742 enum_type: "MavCmd",
9743 value: tmp as u32,
9744 },
9745 )?;
9746 __struct.target_system = buf.get_u8();
9747 __struct.target_component = buf.get_u8();
9748 let tmp = buf.get_u8();
9749 __struct.frame =
9750 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9751 enum_type: "MavFrame",
9752 value: tmp as u32,
9753 })?;
9754 __struct.current = buf.get_u8();
9755 __struct.autocontinue = buf.get_u8();
9756 Ok(__struct)
9757 }
9758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9759 let mut __tmp = BytesMut::new(bytes);
9760 #[allow(clippy::absurd_extreme_comparisons)]
9761 #[allow(unused_comparisons)]
9762 if __tmp.remaining() < Self::ENCODED_LEN {
9763 panic!(
9764 "buffer is too small (need {} bytes, but got {})",
9765 Self::ENCODED_LEN,
9766 __tmp.remaining(),
9767 )
9768 }
9769 __tmp.put_f32_le(self.param1);
9770 __tmp.put_f32_le(self.param2);
9771 __tmp.put_f32_le(self.param3);
9772 __tmp.put_f32_le(self.param4);
9773 __tmp.put_i32_le(self.x);
9774 __tmp.put_i32_le(self.y);
9775 __tmp.put_f32_le(self.z);
9776 __tmp.put_u16_le(self.command as u16);
9777 __tmp.put_u8(self.target_system);
9778 __tmp.put_u8(self.target_component);
9779 __tmp.put_u8(self.frame as u8);
9780 __tmp.put_u8(self.current);
9781 __tmp.put_u8(self.autocontinue);
9782 if matches!(version, MavlinkVersion::V2) {
9783 let len = __tmp.len();
9784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9785 } else {
9786 __tmp.len()
9787 }
9788 }
9789}
9790#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9791#[doc = ""]
9792#[doc = "ID: 76"]
9793#[derive(Debug, Clone, PartialEq)]
9794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9796pub struct COMMAND_LONG_DATA {
9797 #[doc = "Parameter 1 (for the specific command)."]
9798 pub param1: f32,
9799 #[doc = "Parameter 2 (for the specific command)."]
9800 pub param2: f32,
9801 #[doc = "Parameter 3 (for the specific command)."]
9802 pub param3: f32,
9803 #[doc = "Parameter 4 (for the specific command)."]
9804 pub param4: f32,
9805 #[doc = "Parameter 5 (for the specific command)."]
9806 pub param5: f32,
9807 #[doc = "Parameter 6 (for the specific command)."]
9808 pub param6: f32,
9809 #[doc = "Parameter 7 (for the specific command)."]
9810 pub param7: f32,
9811 #[doc = "Command ID (of command to send)."]
9812 pub command: MavCmd,
9813 #[doc = "System which should execute the command"]
9814 pub target_system: u8,
9815 #[doc = "Component which should execute the command, 0 for all components"]
9816 pub target_component: u8,
9817 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9818 pub confirmation: u8,
9819}
9820impl COMMAND_LONG_DATA {
9821 pub const ENCODED_LEN: usize = 33usize;
9822 pub const DEFAULT: Self = Self {
9823 param1: 0.0_f32,
9824 param2: 0.0_f32,
9825 param3: 0.0_f32,
9826 param4: 0.0_f32,
9827 param5: 0.0_f32,
9828 param6: 0.0_f32,
9829 param7: 0.0_f32,
9830 command: MavCmd::DEFAULT,
9831 target_system: 0_u8,
9832 target_component: 0_u8,
9833 confirmation: 0_u8,
9834 };
9835 #[cfg(feature = "arbitrary")]
9836 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9837 use arbitrary::{Arbitrary, Unstructured};
9838 let mut buf = [0u8; 1024];
9839 rng.fill_bytes(&mut buf);
9840 let mut unstructured = Unstructured::new(&buf);
9841 Self::arbitrary(&mut unstructured).unwrap_or_default()
9842 }
9843}
9844impl Default for COMMAND_LONG_DATA {
9845 fn default() -> Self {
9846 Self::DEFAULT.clone()
9847 }
9848}
9849impl MessageData for COMMAND_LONG_DATA {
9850 type Message = MavMessage;
9851 const ID: u32 = 76u32;
9852 const NAME: &'static str = "COMMAND_LONG";
9853 const EXTRA_CRC: u8 = 152u8;
9854 const ENCODED_LEN: usize = 33usize;
9855 fn deser(
9856 _version: MavlinkVersion,
9857 __input: &[u8],
9858 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9859 let avail_len = __input.len();
9860 let mut payload_buf = [0; Self::ENCODED_LEN];
9861 let mut buf = if avail_len < Self::ENCODED_LEN {
9862 payload_buf[0..avail_len].copy_from_slice(__input);
9863 Bytes::new(&payload_buf)
9864 } else {
9865 Bytes::new(__input)
9866 };
9867 let mut __struct = Self::default();
9868 __struct.param1 = buf.get_f32_le();
9869 __struct.param2 = buf.get_f32_le();
9870 __struct.param3 = buf.get_f32_le();
9871 __struct.param4 = buf.get_f32_le();
9872 __struct.param5 = buf.get_f32_le();
9873 __struct.param6 = buf.get_f32_le();
9874 __struct.param7 = buf.get_f32_le();
9875 let tmp = buf.get_u16_le();
9876 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9877 ::mavlink_core::error::ParserError::InvalidEnum {
9878 enum_type: "MavCmd",
9879 value: tmp as u32,
9880 },
9881 )?;
9882 __struct.target_system = buf.get_u8();
9883 __struct.target_component = buf.get_u8();
9884 __struct.confirmation = buf.get_u8();
9885 Ok(__struct)
9886 }
9887 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9888 let mut __tmp = BytesMut::new(bytes);
9889 #[allow(clippy::absurd_extreme_comparisons)]
9890 #[allow(unused_comparisons)]
9891 if __tmp.remaining() < Self::ENCODED_LEN {
9892 panic!(
9893 "buffer is too small (need {} bytes, but got {})",
9894 Self::ENCODED_LEN,
9895 __tmp.remaining(),
9896 )
9897 }
9898 __tmp.put_f32_le(self.param1);
9899 __tmp.put_f32_le(self.param2);
9900 __tmp.put_f32_le(self.param3);
9901 __tmp.put_f32_le(self.param4);
9902 __tmp.put_f32_le(self.param5);
9903 __tmp.put_f32_le(self.param6);
9904 __tmp.put_f32_le(self.param7);
9905 __tmp.put_u16_le(self.command as u16);
9906 __tmp.put_u8(self.target_system);
9907 __tmp.put_u8(self.target_component);
9908 __tmp.put_u8(self.confirmation);
9909 if matches!(version, MavlinkVersion::V2) {
9910 let len = __tmp.len();
9911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9912 } else {
9913 __tmp.len()
9914 }
9915 }
9916}
9917#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9918#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9919#[doc = ""]
9920#[doc = "ID: 395"]
9921#[derive(Debug, Clone, PartialEq)]
9922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9924pub struct COMPONENT_INFORMATION_DATA {
9925 #[doc = "Timestamp (time since system boot)."]
9926 pub time_boot_ms: u32,
9927 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9928 pub general_metadata_file_crc: u32,
9929 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9930 pub peripherals_metadata_file_crc: u32,
9931 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9932 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9933 pub general_metadata_uri: [u8; 100],
9934 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9935 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9936 pub peripherals_metadata_uri: [u8; 100],
9937}
9938impl COMPONENT_INFORMATION_DATA {
9939 pub const ENCODED_LEN: usize = 212usize;
9940 pub const DEFAULT: Self = Self {
9941 time_boot_ms: 0_u32,
9942 general_metadata_file_crc: 0_u32,
9943 peripherals_metadata_file_crc: 0_u32,
9944 general_metadata_uri: [0_u8; 100usize],
9945 peripherals_metadata_uri: [0_u8; 100usize],
9946 };
9947 #[cfg(feature = "arbitrary")]
9948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9949 use arbitrary::{Arbitrary, Unstructured};
9950 let mut buf = [0u8; 1024];
9951 rng.fill_bytes(&mut buf);
9952 let mut unstructured = Unstructured::new(&buf);
9953 Self::arbitrary(&mut unstructured).unwrap_or_default()
9954 }
9955}
9956impl Default for COMPONENT_INFORMATION_DATA {
9957 fn default() -> Self {
9958 Self::DEFAULT.clone()
9959 }
9960}
9961impl MessageData for COMPONENT_INFORMATION_DATA {
9962 type Message = MavMessage;
9963 const ID: u32 = 395u32;
9964 const NAME: &'static str = "COMPONENT_INFORMATION";
9965 const EXTRA_CRC: u8 = 0u8;
9966 const ENCODED_LEN: usize = 212usize;
9967 fn deser(
9968 _version: MavlinkVersion,
9969 __input: &[u8],
9970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9971 let avail_len = __input.len();
9972 let mut payload_buf = [0; Self::ENCODED_LEN];
9973 let mut buf = if avail_len < Self::ENCODED_LEN {
9974 payload_buf[0..avail_len].copy_from_slice(__input);
9975 Bytes::new(&payload_buf)
9976 } else {
9977 Bytes::new(__input)
9978 };
9979 let mut __struct = Self::default();
9980 __struct.time_boot_ms = buf.get_u32_le();
9981 __struct.general_metadata_file_crc = buf.get_u32_le();
9982 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9983 for v in &mut __struct.general_metadata_uri {
9984 let val = buf.get_u8();
9985 *v = val;
9986 }
9987 for v in &mut __struct.peripherals_metadata_uri {
9988 let val = buf.get_u8();
9989 *v = val;
9990 }
9991 Ok(__struct)
9992 }
9993 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9994 let mut __tmp = BytesMut::new(bytes);
9995 #[allow(clippy::absurd_extreme_comparisons)]
9996 #[allow(unused_comparisons)]
9997 if __tmp.remaining() < Self::ENCODED_LEN {
9998 panic!(
9999 "buffer is too small (need {} bytes, but got {})",
10000 Self::ENCODED_LEN,
10001 __tmp.remaining(),
10002 )
10003 }
10004 __tmp.put_u32_le(self.time_boot_ms);
10005 __tmp.put_u32_le(self.general_metadata_file_crc);
10006 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
10007 for val in &self.general_metadata_uri {
10008 __tmp.put_u8(*val);
10009 }
10010 for val in &self.peripherals_metadata_uri {
10011 __tmp.put_u8(*val);
10012 }
10013 if matches!(version, MavlinkVersion::V2) {
10014 let len = __tmp.len();
10015 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10016 } else {
10017 __tmp.len()
10018 }
10019 }
10020}
10021#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
10022#[doc = ""]
10023#[doc = "ID: 396"]
10024#[derive(Debug, Clone, PartialEq)]
10025#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10026#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10027pub struct COMPONENT_INFORMATION_BASIC_DATA {
10028 #[doc = "Component capability flags"]
10029 pub capabilities: MavProtocolCapability,
10030 #[doc = "Timestamp (time since system boot)."]
10031 pub time_boot_ms: u32,
10032 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
10033 pub time_manufacture_s: u32,
10034 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
10035 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10036 pub vendor_name: [u8; 32],
10037 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
10038 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10039 pub model_name: [u8; 32],
10040 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10041 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10042 pub software_version: [u8; 24],
10043 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10045 pub hardware_version: [u8; 24],
10046 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10048 pub serial_number: [u8; 32],
10049}
10050impl COMPONENT_INFORMATION_BASIC_DATA {
10051 pub const ENCODED_LEN: usize = 160usize;
10052 pub const DEFAULT: Self = Self {
10053 capabilities: MavProtocolCapability::DEFAULT,
10054 time_boot_ms: 0_u32,
10055 time_manufacture_s: 0_u32,
10056 vendor_name: [0_u8; 32usize],
10057 model_name: [0_u8; 32usize],
10058 software_version: [0_u8; 24usize],
10059 hardware_version: [0_u8; 24usize],
10060 serial_number: [0_u8; 32usize],
10061 };
10062 #[cfg(feature = "arbitrary")]
10063 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10064 use arbitrary::{Arbitrary, Unstructured};
10065 let mut buf = [0u8; 1024];
10066 rng.fill_bytes(&mut buf);
10067 let mut unstructured = Unstructured::new(&buf);
10068 Self::arbitrary(&mut unstructured).unwrap_or_default()
10069 }
10070}
10071impl Default for COMPONENT_INFORMATION_BASIC_DATA {
10072 fn default() -> Self {
10073 Self::DEFAULT.clone()
10074 }
10075}
10076impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
10077 type Message = MavMessage;
10078 const ID: u32 = 396u32;
10079 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
10080 const EXTRA_CRC: u8 = 50u8;
10081 const ENCODED_LEN: usize = 160usize;
10082 fn deser(
10083 _version: MavlinkVersion,
10084 __input: &[u8],
10085 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10086 let avail_len = __input.len();
10087 let mut payload_buf = [0; Self::ENCODED_LEN];
10088 let mut buf = if avail_len < Self::ENCODED_LEN {
10089 payload_buf[0..avail_len].copy_from_slice(__input);
10090 Bytes::new(&payload_buf)
10091 } else {
10092 Bytes::new(__input)
10093 };
10094 let mut __struct = Self::default();
10095 let tmp = buf.get_u64_le();
10096 __struct.capabilities = MavProtocolCapability::from_bits(
10097 tmp & MavProtocolCapability::all().bits(),
10098 )
10099 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10100 flag_type: "MavProtocolCapability",
10101 value: tmp as u32,
10102 })?;
10103 __struct.time_boot_ms = buf.get_u32_le();
10104 __struct.time_manufacture_s = buf.get_u32_le();
10105 for v in &mut __struct.vendor_name {
10106 let val = buf.get_u8();
10107 *v = val;
10108 }
10109 for v in &mut __struct.model_name {
10110 let val = buf.get_u8();
10111 *v = val;
10112 }
10113 for v in &mut __struct.software_version {
10114 let val = buf.get_u8();
10115 *v = val;
10116 }
10117 for v in &mut __struct.hardware_version {
10118 let val = buf.get_u8();
10119 *v = val;
10120 }
10121 for v in &mut __struct.serial_number {
10122 let val = buf.get_u8();
10123 *v = val;
10124 }
10125 Ok(__struct)
10126 }
10127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10128 let mut __tmp = BytesMut::new(bytes);
10129 #[allow(clippy::absurd_extreme_comparisons)]
10130 #[allow(unused_comparisons)]
10131 if __tmp.remaining() < Self::ENCODED_LEN {
10132 panic!(
10133 "buffer is too small (need {} bytes, but got {})",
10134 Self::ENCODED_LEN,
10135 __tmp.remaining(),
10136 )
10137 }
10138 __tmp.put_u64_le(self.capabilities.bits());
10139 __tmp.put_u32_le(self.time_boot_ms);
10140 __tmp.put_u32_le(self.time_manufacture_s);
10141 for val in &self.vendor_name {
10142 __tmp.put_u8(*val);
10143 }
10144 for val in &self.model_name {
10145 __tmp.put_u8(*val);
10146 }
10147 for val in &self.software_version {
10148 __tmp.put_u8(*val);
10149 }
10150 for val in &self.hardware_version {
10151 __tmp.put_u8(*val);
10152 }
10153 for val in &self.serial_number {
10154 __tmp.put_u8(*val);
10155 }
10156 if matches!(version, MavlinkVersion::V2) {
10157 let len = __tmp.len();
10158 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10159 } else {
10160 __tmp.len()
10161 }
10162 }
10163}
10164#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
10165#[doc = ""]
10166#[doc = "ID: 397"]
10167#[derive(Debug, Clone, PartialEq)]
10168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10170pub struct COMPONENT_METADATA_DATA {
10171 #[doc = "Timestamp (time since system boot)."]
10172 pub time_boot_ms: u32,
10173 #[doc = "CRC32 of the general metadata file."]
10174 pub file_crc: u32,
10175 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
10176 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10177 pub uri: [u8; 100],
10178}
10179impl COMPONENT_METADATA_DATA {
10180 pub const ENCODED_LEN: usize = 108usize;
10181 pub const DEFAULT: Self = Self {
10182 time_boot_ms: 0_u32,
10183 file_crc: 0_u32,
10184 uri: [0_u8; 100usize],
10185 };
10186 #[cfg(feature = "arbitrary")]
10187 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10188 use arbitrary::{Arbitrary, Unstructured};
10189 let mut buf = [0u8; 1024];
10190 rng.fill_bytes(&mut buf);
10191 let mut unstructured = Unstructured::new(&buf);
10192 Self::arbitrary(&mut unstructured).unwrap_or_default()
10193 }
10194}
10195impl Default for COMPONENT_METADATA_DATA {
10196 fn default() -> Self {
10197 Self::DEFAULT.clone()
10198 }
10199}
10200impl MessageData for COMPONENT_METADATA_DATA {
10201 type Message = MavMessage;
10202 const ID: u32 = 397u32;
10203 const NAME: &'static str = "COMPONENT_METADATA";
10204 const EXTRA_CRC: u8 = 182u8;
10205 const ENCODED_LEN: usize = 108usize;
10206 fn deser(
10207 _version: MavlinkVersion,
10208 __input: &[u8],
10209 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10210 let avail_len = __input.len();
10211 let mut payload_buf = [0; Self::ENCODED_LEN];
10212 let mut buf = if avail_len < Self::ENCODED_LEN {
10213 payload_buf[0..avail_len].copy_from_slice(__input);
10214 Bytes::new(&payload_buf)
10215 } else {
10216 Bytes::new(__input)
10217 };
10218 let mut __struct = Self::default();
10219 __struct.time_boot_ms = buf.get_u32_le();
10220 __struct.file_crc = buf.get_u32_le();
10221 for v in &mut __struct.uri {
10222 let val = buf.get_u8();
10223 *v = val;
10224 }
10225 Ok(__struct)
10226 }
10227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10228 let mut __tmp = BytesMut::new(bytes);
10229 #[allow(clippy::absurd_extreme_comparisons)]
10230 #[allow(unused_comparisons)]
10231 if __tmp.remaining() < Self::ENCODED_LEN {
10232 panic!(
10233 "buffer is too small (need {} bytes, but got {})",
10234 Self::ENCODED_LEN,
10235 __tmp.remaining(),
10236 )
10237 }
10238 __tmp.put_u32_le(self.time_boot_ms);
10239 __tmp.put_u32_le(self.file_crc);
10240 for val in &self.uri {
10241 __tmp.put_u8(*val);
10242 }
10243 if matches!(version, MavlinkVersion::V2) {
10244 let len = __tmp.len();
10245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10246 } else {
10247 __tmp.len()
10248 }
10249 }
10250}
10251#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
10252#[doc = ""]
10253#[doc = "ID: 146"]
10254#[derive(Debug, Clone, PartialEq)]
10255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10257pub struct CONTROL_SYSTEM_STATE_DATA {
10258 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10259 pub time_usec: u64,
10260 #[doc = "X acceleration in body frame"]
10261 pub x_acc: f32,
10262 #[doc = "Y acceleration in body frame"]
10263 pub y_acc: f32,
10264 #[doc = "Z acceleration in body frame"]
10265 pub z_acc: f32,
10266 #[doc = "X velocity in body frame"]
10267 pub x_vel: f32,
10268 #[doc = "Y velocity in body frame"]
10269 pub y_vel: f32,
10270 #[doc = "Z velocity in body frame"]
10271 pub z_vel: f32,
10272 #[doc = "X position in local frame"]
10273 pub x_pos: f32,
10274 #[doc = "Y position in local frame"]
10275 pub y_pos: f32,
10276 #[doc = "Z position in local frame"]
10277 pub z_pos: f32,
10278 #[doc = "Airspeed, set to -1 if unknown"]
10279 pub airspeed: f32,
10280 #[doc = "Variance of body velocity estimate"]
10281 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10282 pub vel_variance: [f32; 3],
10283 #[doc = "Variance in local position"]
10284 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10285 pub pos_variance: [f32; 3],
10286 #[doc = "The attitude, represented as Quaternion"]
10287 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10288 pub q: [f32; 4],
10289 #[doc = "Angular rate in roll axis"]
10290 pub roll_rate: f32,
10291 #[doc = "Angular rate in pitch axis"]
10292 pub pitch_rate: f32,
10293 #[doc = "Angular rate in yaw axis"]
10294 pub yaw_rate: f32,
10295}
10296impl CONTROL_SYSTEM_STATE_DATA {
10297 pub const ENCODED_LEN: usize = 100usize;
10298 pub const DEFAULT: Self = Self {
10299 time_usec: 0_u64,
10300 x_acc: 0.0_f32,
10301 y_acc: 0.0_f32,
10302 z_acc: 0.0_f32,
10303 x_vel: 0.0_f32,
10304 y_vel: 0.0_f32,
10305 z_vel: 0.0_f32,
10306 x_pos: 0.0_f32,
10307 y_pos: 0.0_f32,
10308 z_pos: 0.0_f32,
10309 airspeed: 0.0_f32,
10310 vel_variance: [0.0_f32; 3usize],
10311 pos_variance: [0.0_f32; 3usize],
10312 q: [0.0_f32; 4usize],
10313 roll_rate: 0.0_f32,
10314 pitch_rate: 0.0_f32,
10315 yaw_rate: 0.0_f32,
10316 };
10317 #[cfg(feature = "arbitrary")]
10318 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10319 use arbitrary::{Arbitrary, Unstructured};
10320 let mut buf = [0u8; 1024];
10321 rng.fill_bytes(&mut buf);
10322 let mut unstructured = Unstructured::new(&buf);
10323 Self::arbitrary(&mut unstructured).unwrap_or_default()
10324 }
10325}
10326impl Default for CONTROL_SYSTEM_STATE_DATA {
10327 fn default() -> Self {
10328 Self::DEFAULT.clone()
10329 }
10330}
10331impl MessageData for CONTROL_SYSTEM_STATE_DATA {
10332 type Message = MavMessage;
10333 const ID: u32 = 146u32;
10334 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
10335 const EXTRA_CRC: u8 = 103u8;
10336 const ENCODED_LEN: usize = 100usize;
10337 fn deser(
10338 _version: MavlinkVersion,
10339 __input: &[u8],
10340 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10341 let avail_len = __input.len();
10342 let mut payload_buf = [0; Self::ENCODED_LEN];
10343 let mut buf = if avail_len < Self::ENCODED_LEN {
10344 payload_buf[0..avail_len].copy_from_slice(__input);
10345 Bytes::new(&payload_buf)
10346 } else {
10347 Bytes::new(__input)
10348 };
10349 let mut __struct = Self::default();
10350 __struct.time_usec = buf.get_u64_le();
10351 __struct.x_acc = buf.get_f32_le();
10352 __struct.y_acc = buf.get_f32_le();
10353 __struct.z_acc = buf.get_f32_le();
10354 __struct.x_vel = buf.get_f32_le();
10355 __struct.y_vel = buf.get_f32_le();
10356 __struct.z_vel = buf.get_f32_le();
10357 __struct.x_pos = buf.get_f32_le();
10358 __struct.y_pos = buf.get_f32_le();
10359 __struct.z_pos = buf.get_f32_le();
10360 __struct.airspeed = buf.get_f32_le();
10361 for v in &mut __struct.vel_variance {
10362 let val = buf.get_f32_le();
10363 *v = val;
10364 }
10365 for v in &mut __struct.pos_variance {
10366 let val = buf.get_f32_le();
10367 *v = val;
10368 }
10369 for v in &mut __struct.q {
10370 let val = buf.get_f32_le();
10371 *v = val;
10372 }
10373 __struct.roll_rate = buf.get_f32_le();
10374 __struct.pitch_rate = buf.get_f32_le();
10375 __struct.yaw_rate = buf.get_f32_le();
10376 Ok(__struct)
10377 }
10378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10379 let mut __tmp = BytesMut::new(bytes);
10380 #[allow(clippy::absurd_extreme_comparisons)]
10381 #[allow(unused_comparisons)]
10382 if __tmp.remaining() < Self::ENCODED_LEN {
10383 panic!(
10384 "buffer is too small (need {} bytes, but got {})",
10385 Self::ENCODED_LEN,
10386 __tmp.remaining(),
10387 )
10388 }
10389 __tmp.put_u64_le(self.time_usec);
10390 __tmp.put_f32_le(self.x_acc);
10391 __tmp.put_f32_le(self.y_acc);
10392 __tmp.put_f32_le(self.z_acc);
10393 __tmp.put_f32_le(self.x_vel);
10394 __tmp.put_f32_le(self.y_vel);
10395 __tmp.put_f32_le(self.z_vel);
10396 __tmp.put_f32_le(self.x_pos);
10397 __tmp.put_f32_le(self.y_pos);
10398 __tmp.put_f32_le(self.z_pos);
10399 __tmp.put_f32_le(self.airspeed);
10400 for val in &self.vel_variance {
10401 __tmp.put_f32_le(*val);
10402 }
10403 for val in &self.pos_variance {
10404 __tmp.put_f32_le(*val);
10405 }
10406 for val in &self.q {
10407 __tmp.put_f32_le(*val);
10408 }
10409 __tmp.put_f32_le(self.roll_rate);
10410 __tmp.put_f32_le(self.pitch_rate);
10411 __tmp.put_f32_le(self.yaw_rate);
10412 if matches!(version, MavlinkVersion::V2) {
10413 let len = __tmp.len();
10414 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10415 } else {
10416 __tmp.len()
10417 }
10418 }
10419}
10420#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10421#[doc = ""]
10422#[doc = "ID: 411"]
10423#[derive(Debug, Clone, PartialEq)]
10424#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10426pub struct CURRENT_EVENT_SEQUENCE_DATA {
10427 #[doc = "Sequence number."]
10428 pub sequence: u16,
10429 #[doc = "Flag bitset."]
10430 pub flags: MavEventCurrentSequenceFlags,
10431}
10432impl CURRENT_EVENT_SEQUENCE_DATA {
10433 pub const ENCODED_LEN: usize = 3usize;
10434 pub const DEFAULT: Self = Self {
10435 sequence: 0_u16,
10436 flags: MavEventCurrentSequenceFlags::DEFAULT,
10437 };
10438 #[cfg(feature = "arbitrary")]
10439 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10440 use arbitrary::{Arbitrary, Unstructured};
10441 let mut buf = [0u8; 1024];
10442 rng.fill_bytes(&mut buf);
10443 let mut unstructured = Unstructured::new(&buf);
10444 Self::arbitrary(&mut unstructured).unwrap_or_default()
10445 }
10446}
10447impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10448 fn default() -> Self {
10449 Self::DEFAULT.clone()
10450 }
10451}
10452impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10453 type Message = MavMessage;
10454 const ID: u32 = 411u32;
10455 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10456 const EXTRA_CRC: u8 = 106u8;
10457 const ENCODED_LEN: usize = 3usize;
10458 fn deser(
10459 _version: MavlinkVersion,
10460 __input: &[u8],
10461 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10462 let avail_len = __input.len();
10463 let mut payload_buf = [0; Self::ENCODED_LEN];
10464 let mut buf = if avail_len < Self::ENCODED_LEN {
10465 payload_buf[0..avail_len].copy_from_slice(__input);
10466 Bytes::new(&payload_buf)
10467 } else {
10468 Bytes::new(__input)
10469 };
10470 let mut __struct = Self::default();
10471 __struct.sequence = buf.get_u16_le();
10472 let tmp = buf.get_u8();
10473 __struct.flags =
10474 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10475 enum_type: "MavEventCurrentSequenceFlags",
10476 value: tmp as u32,
10477 })?;
10478 Ok(__struct)
10479 }
10480 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10481 let mut __tmp = BytesMut::new(bytes);
10482 #[allow(clippy::absurd_extreme_comparisons)]
10483 #[allow(unused_comparisons)]
10484 if __tmp.remaining() < Self::ENCODED_LEN {
10485 panic!(
10486 "buffer is too small (need {} bytes, but got {})",
10487 Self::ENCODED_LEN,
10488 __tmp.remaining(),
10489 )
10490 }
10491 __tmp.put_u16_le(self.sequence);
10492 __tmp.put_u8(self.flags as u8);
10493 if matches!(version, MavlinkVersion::V2) {
10494 let len = __tmp.len();
10495 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10496 } else {
10497 __tmp.len()
10498 }
10499 }
10500}
10501#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10502#[doc = ""]
10503#[doc = "ID: 436"]
10504#[derive(Debug, Clone, PartialEq)]
10505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10507pub struct CURRENT_MODE_DATA {
10508 #[doc = "A bitfield for use for autopilot-specific flags"]
10509 pub custom_mode: u32,
10510 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10511 pub intended_custom_mode: u32,
10512 #[doc = "Standard mode."]
10513 pub standard_mode: MavStandardMode,
10514}
10515impl CURRENT_MODE_DATA {
10516 pub const ENCODED_LEN: usize = 9usize;
10517 pub const DEFAULT: Self = Self {
10518 custom_mode: 0_u32,
10519 intended_custom_mode: 0_u32,
10520 standard_mode: MavStandardMode::DEFAULT,
10521 };
10522 #[cfg(feature = "arbitrary")]
10523 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10524 use arbitrary::{Arbitrary, Unstructured};
10525 let mut buf = [0u8; 1024];
10526 rng.fill_bytes(&mut buf);
10527 let mut unstructured = Unstructured::new(&buf);
10528 Self::arbitrary(&mut unstructured).unwrap_or_default()
10529 }
10530}
10531impl Default for CURRENT_MODE_DATA {
10532 fn default() -> Self {
10533 Self::DEFAULT.clone()
10534 }
10535}
10536impl MessageData for CURRENT_MODE_DATA {
10537 type Message = MavMessage;
10538 const ID: u32 = 436u32;
10539 const NAME: &'static str = "CURRENT_MODE";
10540 const EXTRA_CRC: u8 = 193u8;
10541 const ENCODED_LEN: usize = 9usize;
10542 fn deser(
10543 _version: MavlinkVersion,
10544 __input: &[u8],
10545 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10546 let avail_len = __input.len();
10547 let mut payload_buf = [0; Self::ENCODED_LEN];
10548 let mut buf = if avail_len < Self::ENCODED_LEN {
10549 payload_buf[0..avail_len].copy_from_slice(__input);
10550 Bytes::new(&payload_buf)
10551 } else {
10552 Bytes::new(__input)
10553 };
10554 let mut __struct = Self::default();
10555 __struct.custom_mode = buf.get_u32_le();
10556 __struct.intended_custom_mode = buf.get_u32_le();
10557 let tmp = buf.get_u8();
10558 __struct.standard_mode =
10559 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10560 enum_type: "MavStandardMode",
10561 value: tmp as u32,
10562 })?;
10563 Ok(__struct)
10564 }
10565 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10566 let mut __tmp = BytesMut::new(bytes);
10567 #[allow(clippy::absurd_extreme_comparisons)]
10568 #[allow(unused_comparisons)]
10569 if __tmp.remaining() < Self::ENCODED_LEN {
10570 panic!(
10571 "buffer is too small (need {} bytes, but got {})",
10572 Self::ENCODED_LEN,
10573 __tmp.remaining(),
10574 )
10575 }
10576 __tmp.put_u32_le(self.custom_mode);
10577 __tmp.put_u32_le(self.intended_custom_mode);
10578 __tmp.put_u8(self.standard_mode as u8);
10579 if matches!(version, MavlinkVersion::V2) {
10580 let len = __tmp.len();
10581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10582 } else {
10583 __tmp.len()
10584 }
10585 }
10586}
10587#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10588#[doc = "Data stream status information."]
10589#[doc = ""]
10590#[doc = "ID: 67"]
10591#[derive(Debug, Clone, PartialEq)]
10592#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10593#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10594pub struct DATA_STREAM_DATA {
10595 #[doc = "The message rate"]
10596 pub message_rate: u16,
10597 #[doc = "The ID of the requested data stream"]
10598 pub stream_id: u8,
10599 #[doc = "1 stream is enabled, 0 stream is stopped."]
10600 pub on_off: u8,
10601}
10602impl DATA_STREAM_DATA {
10603 pub const ENCODED_LEN: usize = 4usize;
10604 pub const DEFAULT: Self = Self {
10605 message_rate: 0_u16,
10606 stream_id: 0_u8,
10607 on_off: 0_u8,
10608 };
10609 #[cfg(feature = "arbitrary")]
10610 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10611 use arbitrary::{Arbitrary, Unstructured};
10612 let mut buf = [0u8; 1024];
10613 rng.fill_bytes(&mut buf);
10614 let mut unstructured = Unstructured::new(&buf);
10615 Self::arbitrary(&mut unstructured).unwrap_or_default()
10616 }
10617}
10618impl Default for DATA_STREAM_DATA {
10619 fn default() -> Self {
10620 Self::DEFAULT.clone()
10621 }
10622}
10623impl MessageData for DATA_STREAM_DATA {
10624 type Message = MavMessage;
10625 const ID: u32 = 67u32;
10626 const NAME: &'static str = "DATA_STREAM";
10627 const EXTRA_CRC: u8 = 21u8;
10628 const ENCODED_LEN: usize = 4usize;
10629 fn deser(
10630 _version: MavlinkVersion,
10631 __input: &[u8],
10632 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10633 let avail_len = __input.len();
10634 let mut payload_buf = [0; Self::ENCODED_LEN];
10635 let mut buf = if avail_len < Self::ENCODED_LEN {
10636 payload_buf[0..avail_len].copy_from_slice(__input);
10637 Bytes::new(&payload_buf)
10638 } else {
10639 Bytes::new(__input)
10640 };
10641 let mut __struct = Self::default();
10642 __struct.message_rate = buf.get_u16_le();
10643 __struct.stream_id = buf.get_u8();
10644 __struct.on_off = buf.get_u8();
10645 Ok(__struct)
10646 }
10647 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10648 let mut __tmp = BytesMut::new(bytes);
10649 #[allow(clippy::absurd_extreme_comparisons)]
10650 #[allow(unused_comparisons)]
10651 if __tmp.remaining() < Self::ENCODED_LEN {
10652 panic!(
10653 "buffer is too small (need {} bytes, but got {})",
10654 Self::ENCODED_LEN,
10655 __tmp.remaining(),
10656 )
10657 }
10658 __tmp.put_u16_le(self.message_rate);
10659 __tmp.put_u8(self.stream_id);
10660 __tmp.put_u8(self.on_off);
10661 if matches!(version, MavlinkVersion::V2) {
10662 let len = __tmp.len();
10663 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10664 } else {
10665 __tmp.len()
10666 }
10667 }
10668}
10669#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10670#[doc = ""]
10671#[doc = "ID: 130"]
10672#[derive(Debug, Clone, PartialEq)]
10673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10675pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10676 #[doc = "total data size (set on ACK only)."]
10677 pub size: u32,
10678 #[doc = "Width of a matrix or image."]
10679 pub width: u16,
10680 #[doc = "Height of a matrix or image."]
10681 pub height: u16,
10682 #[doc = "Number of packets being sent (set on ACK only)."]
10683 pub packets: u16,
10684 #[doc = "Type of requested/acknowledged data."]
10685 pub mavtype: MavlinkDataStreamType,
10686 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10687 pub payload: u8,
10688 #[doc = "JPEG quality. Values: [1-100]."]
10689 pub jpg_quality: u8,
10690}
10691impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10692 pub const ENCODED_LEN: usize = 13usize;
10693 pub const DEFAULT: Self = Self {
10694 size: 0_u32,
10695 width: 0_u16,
10696 height: 0_u16,
10697 packets: 0_u16,
10698 mavtype: MavlinkDataStreamType::DEFAULT,
10699 payload: 0_u8,
10700 jpg_quality: 0_u8,
10701 };
10702 #[cfg(feature = "arbitrary")]
10703 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10704 use arbitrary::{Arbitrary, Unstructured};
10705 let mut buf = [0u8; 1024];
10706 rng.fill_bytes(&mut buf);
10707 let mut unstructured = Unstructured::new(&buf);
10708 Self::arbitrary(&mut unstructured).unwrap_or_default()
10709 }
10710}
10711impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10712 fn default() -> Self {
10713 Self::DEFAULT.clone()
10714 }
10715}
10716impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10717 type Message = MavMessage;
10718 const ID: u32 = 130u32;
10719 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10720 const EXTRA_CRC: u8 = 29u8;
10721 const ENCODED_LEN: usize = 13usize;
10722 fn deser(
10723 _version: MavlinkVersion,
10724 __input: &[u8],
10725 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10726 let avail_len = __input.len();
10727 let mut payload_buf = [0; Self::ENCODED_LEN];
10728 let mut buf = if avail_len < Self::ENCODED_LEN {
10729 payload_buf[0..avail_len].copy_from_slice(__input);
10730 Bytes::new(&payload_buf)
10731 } else {
10732 Bytes::new(__input)
10733 };
10734 let mut __struct = Self::default();
10735 __struct.size = buf.get_u32_le();
10736 __struct.width = buf.get_u16_le();
10737 __struct.height = buf.get_u16_le();
10738 __struct.packets = buf.get_u16_le();
10739 let tmp = buf.get_u8();
10740 __struct.mavtype =
10741 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10742 enum_type: "MavlinkDataStreamType",
10743 value: tmp as u32,
10744 })?;
10745 __struct.payload = buf.get_u8();
10746 __struct.jpg_quality = buf.get_u8();
10747 Ok(__struct)
10748 }
10749 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10750 let mut __tmp = BytesMut::new(bytes);
10751 #[allow(clippy::absurd_extreme_comparisons)]
10752 #[allow(unused_comparisons)]
10753 if __tmp.remaining() < Self::ENCODED_LEN {
10754 panic!(
10755 "buffer is too small (need {} bytes, but got {})",
10756 Self::ENCODED_LEN,
10757 __tmp.remaining(),
10758 )
10759 }
10760 __tmp.put_u32_le(self.size);
10761 __tmp.put_u16_le(self.width);
10762 __tmp.put_u16_le(self.height);
10763 __tmp.put_u16_le(self.packets);
10764 __tmp.put_u8(self.mavtype as u8);
10765 __tmp.put_u8(self.payload);
10766 __tmp.put_u8(self.jpg_quality);
10767 if matches!(version, MavlinkVersion::V2) {
10768 let len = __tmp.len();
10769 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10770 } else {
10771 __tmp.len()
10772 }
10773 }
10774}
10775#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10776#[doc = ""]
10777#[doc = "ID: 254"]
10778#[derive(Debug, Clone, PartialEq)]
10779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10780#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10781pub struct DEBUG_DATA {
10782 #[doc = "Timestamp (time since system boot)."]
10783 pub time_boot_ms: u32,
10784 #[doc = "DEBUG value"]
10785 pub value: f32,
10786 #[doc = "index of debug variable"]
10787 pub ind: u8,
10788}
10789impl DEBUG_DATA {
10790 pub const ENCODED_LEN: usize = 9usize;
10791 pub const DEFAULT: Self = Self {
10792 time_boot_ms: 0_u32,
10793 value: 0.0_f32,
10794 ind: 0_u8,
10795 };
10796 #[cfg(feature = "arbitrary")]
10797 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10798 use arbitrary::{Arbitrary, Unstructured};
10799 let mut buf = [0u8; 1024];
10800 rng.fill_bytes(&mut buf);
10801 let mut unstructured = Unstructured::new(&buf);
10802 Self::arbitrary(&mut unstructured).unwrap_or_default()
10803 }
10804}
10805impl Default for DEBUG_DATA {
10806 fn default() -> Self {
10807 Self::DEFAULT.clone()
10808 }
10809}
10810impl MessageData for DEBUG_DATA {
10811 type Message = MavMessage;
10812 const ID: u32 = 254u32;
10813 const NAME: &'static str = "DEBUG";
10814 const EXTRA_CRC: u8 = 46u8;
10815 const ENCODED_LEN: usize = 9usize;
10816 fn deser(
10817 _version: MavlinkVersion,
10818 __input: &[u8],
10819 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10820 let avail_len = __input.len();
10821 let mut payload_buf = [0; Self::ENCODED_LEN];
10822 let mut buf = if avail_len < Self::ENCODED_LEN {
10823 payload_buf[0..avail_len].copy_from_slice(__input);
10824 Bytes::new(&payload_buf)
10825 } else {
10826 Bytes::new(__input)
10827 };
10828 let mut __struct = Self::default();
10829 __struct.time_boot_ms = buf.get_u32_le();
10830 __struct.value = buf.get_f32_le();
10831 __struct.ind = buf.get_u8();
10832 Ok(__struct)
10833 }
10834 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10835 let mut __tmp = BytesMut::new(bytes);
10836 #[allow(clippy::absurd_extreme_comparisons)]
10837 #[allow(unused_comparisons)]
10838 if __tmp.remaining() < Self::ENCODED_LEN {
10839 panic!(
10840 "buffer is too small (need {} bytes, but got {})",
10841 Self::ENCODED_LEN,
10842 __tmp.remaining(),
10843 )
10844 }
10845 __tmp.put_u32_le(self.time_boot_ms);
10846 __tmp.put_f32_le(self.value);
10847 __tmp.put_u8(self.ind);
10848 if matches!(version, MavlinkVersion::V2) {
10849 let len = __tmp.len();
10850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10851 } else {
10852 __tmp.len()
10853 }
10854 }
10855}
10856#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10857#[doc = ""]
10858#[doc = "ID: 350"]
10859#[derive(Debug, Clone, PartialEq)]
10860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10862pub struct DEBUG_FLOAT_ARRAY_DATA {
10863 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10864 pub time_usec: u64,
10865 #[doc = "Unique ID used to discriminate between arrays"]
10866 pub array_id: u16,
10867 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10868 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10869 pub name: [u8; 10],
10870 #[doc = "data"]
10871 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10872 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10873 pub data: [f32; 58],
10874}
10875impl DEBUG_FLOAT_ARRAY_DATA {
10876 pub const ENCODED_LEN: usize = 252usize;
10877 pub const DEFAULT: Self = Self {
10878 time_usec: 0_u64,
10879 array_id: 0_u16,
10880 name: [0_u8; 10usize],
10881 data: [0.0_f32; 58usize],
10882 };
10883 #[cfg(feature = "arbitrary")]
10884 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10885 use arbitrary::{Arbitrary, Unstructured};
10886 let mut buf = [0u8; 1024];
10887 rng.fill_bytes(&mut buf);
10888 let mut unstructured = Unstructured::new(&buf);
10889 Self::arbitrary(&mut unstructured).unwrap_or_default()
10890 }
10891}
10892impl Default for DEBUG_FLOAT_ARRAY_DATA {
10893 fn default() -> Self {
10894 Self::DEFAULT.clone()
10895 }
10896}
10897impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10898 type Message = MavMessage;
10899 const ID: u32 = 350u32;
10900 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10901 const EXTRA_CRC: u8 = 232u8;
10902 const ENCODED_LEN: usize = 252usize;
10903 fn deser(
10904 _version: MavlinkVersion,
10905 __input: &[u8],
10906 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10907 let avail_len = __input.len();
10908 let mut payload_buf = [0; Self::ENCODED_LEN];
10909 let mut buf = if avail_len < Self::ENCODED_LEN {
10910 payload_buf[0..avail_len].copy_from_slice(__input);
10911 Bytes::new(&payload_buf)
10912 } else {
10913 Bytes::new(__input)
10914 };
10915 let mut __struct = Self::default();
10916 __struct.time_usec = buf.get_u64_le();
10917 __struct.array_id = buf.get_u16_le();
10918 for v in &mut __struct.name {
10919 let val = buf.get_u8();
10920 *v = val;
10921 }
10922 for v in &mut __struct.data {
10923 let val = buf.get_f32_le();
10924 *v = val;
10925 }
10926 Ok(__struct)
10927 }
10928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10929 let mut __tmp = BytesMut::new(bytes);
10930 #[allow(clippy::absurd_extreme_comparisons)]
10931 #[allow(unused_comparisons)]
10932 if __tmp.remaining() < Self::ENCODED_LEN {
10933 panic!(
10934 "buffer is too small (need {} bytes, but got {})",
10935 Self::ENCODED_LEN,
10936 __tmp.remaining(),
10937 )
10938 }
10939 __tmp.put_u64_le(self.time_usec);
10940 __tmp.put_u16_le(self.array_id);
10941 for val in &self.name {
10942 __tmp.put_u8(*val);
10943 }
10944 if matches!(version, MavlinkVersion::V2) {
10945 for val in &self.data {
10946 __tmp.put_f32_le(*val);
10947 }
10948 let len = __tmp.len();
10949 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10950 } else {
10951 __tmp.len()
10952 }
10953 }
10954}
10955#[doc = "To debug something using a named 3D vector."]
10956#[doc = ""]
10957#[doc = "ID: 250"]
10958#[derive(Debug, Clone, PartialEq)]
10959#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10960#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10961pub struct DEBUG_VECT_DATA {
10962 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10963 pub time_usec: u64,
10964 #[doc = "x"]
10965 pub x: f32,
10966 #[doc = "y"]
10967 pub y: f32,
10968 #[doc = "z"]
10969 pub z: f32,
10970 #[doc = "Name"]
10971 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10972 pub name: [u8; 10],
10973}
10974impl DEBUG_VECT_DATA {
10975 pub const ENCODED_LEN: usize = 30usize;
10976 pub const DEFAULT: Self = Self {
10977 time_usec: 0_u64,
10978 x: 0.0_f32,
10979 y: 0.0_f32,
10980 z: 0.0_f32,
10981 name: [0_u8; 10usize],
10982 };
10983 #[cfg(feature = "arbitrary")]
10984 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10985 use arbitrary::{Arbitrary, Unstructured};
10986 let mut buf = [0u8; 1024];
10987 rng.fill_bytes(&mut buf);
10988 let mut unstructured = Unstructured::new(&buf);
10989 Self::arbitrary(&mut unstructured).unwrap_or_default()
10990 }
10991}
10992impl Default for DEBUG_VECT_DATA {
10993 fn default() -> Self {
10994 Self::DEFAULT.clone()
10995 }
10996}
10997impl MessageData for DEBUG_VECT_DATA {
10998 type Message = MavMessage;
10999 const ID: u32 = 250u32;
11000 const NAME: &'static str = "DEBUG_VECT";
11001 const EXTRA_CRC: u8 = 49u8;
11002 const ENCODED_LEN: usize = 30usize;
11003 fn deser(
11004 _version: MavlinkVersion,
11005 __input: &[u8],
11006 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11007 let avail_len = __input.len();
11008 let mut payload_buf = [0; Self::ENCODED_LEN];
11009 let mut buf = if avail_len < Self::ENCODED_LEN {
11010 payload_buf[0..avail_len].copy_from_slice(__input);
11011 Bytes::new(&payload_buf)
11012 } else {
11013 Bytes::new(__input)
11014 };
11015 let mut __struct = Self::default();
11016 __struct.time_usec = buf.get_u64_le();
11017 __struct.x = buf.get_f32_le();
11018 __struct.y = buf.get_f32_le();
11019 __struct.z = buf.get_f32_le();
11020 for v in &mut __struct.name {
11021 let val = buf.get_u8();
11022 *v = val;
11023 }
11024 Ok(__struct)
11025 }
11026 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11027 let mut __tmp = BytesMut::new(bytes);
11028 #[allow(clippy::absurd_extreme_comparisons)]
11029 #[allow(unused_comparisons)]
11030 if __tmp.remaining() < Self::ENCODED_LEN {
11031 panic!(
11032 "buffer is too small (need {} bytes, but got {})",
11033 Self::ENCODED_LEN,
11034 __tmp.remaining(),
11035 )
11036 }
11037 __tmp.put_u64_le(self.time_usec);
11038 __tmp.put_f32_le(self.x);
11039 __tmp.put_f32_le(self.y);
11040 __tmp.put_f32_le(self.z);
11041 for val in &self.name {
11042 __tmp.put_u8(*val);
11043 }
11044 if matches!(version, MavlinkVersion::V2) {
11045 let len = __tmp.len();
11046 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11047 } else {
11048 __tmp.len()
11049 }
11050 }
11051}
11052#[doc = "Distance sensor information for an onboard rangefinder."]
11053#[doc = ""]
11054#[doc = "ID: 132"]
11055#[derive(Debug, Clone, PartialEq)]
11056#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11057#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11058pub struct DISTANCE_SENSOR_DATA {
11059 #[doc = "Timestamp (time since system boot)."]
11060 pub time_boot_ms: u32,
11061 #[doc = "Minimum distance the sensor can measure"]
11062 pub min_distance: u16,
11063 #[doc = "Maximum distance the sensor can measure"]
11064 pub max_distance: u16,
11065 #[doc = "Current distance reading"]
11066 pub current_distance: u16,
11067 #[doc = "Type of distance sensor."]
11068 pub mavtype: MavDistanceSensor,
11069 #[doc = "Onboard ID of the sensor"]
11070 pub id: u8,
11071 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
11072 pub orientation: MavSensorOrientation,
11073 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
11074 pub covariance: u8,
11075 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
11076 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11077 pub horizontal_fov: f32,
11078 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
11079 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11080 pub vertical_fov: f32,
11081 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
11082 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11083 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11084 pub quaternion: [f32; 4],
11085 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
11086 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11087 pub signal_quality: u8,
11088}
11089impl DISTANCE_SENSOR_DATA {
11090 pub const ENCODED_LEN: usize = 39usize;
11091 pub const DEFAULT: Self = Self {
11092 time_boot_ms: 0_u32,
11093 min_distance: 0_u16,
11094 max_distance: 0_u16,
11095 current_distance: 0_u16,
11096 mavtype: MavDistanceSensor::DEFAULT,
11097 id: 0_u8,
11098 orientation: MavSensorOrientation::DEFAULT,
11099 covariance: 0_u8,
11100 horizontal_fov: 0.0_f32,
11101 vertical_fov: 0.0_f32,
11102 quaternion: [0.0_f32; 4usize],
11103 signal_quality: 0_u8,
11104 };
11105 #[cfg(feature = "arbitrary")]
11106 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11107 use arbitrary::{Arbitrary, Unstructured};
11108 let mut buf = [0u8; 1024];
11109 rng.fill_bytes(&mut buf);
11110 let mut unstructured = Unstructured::new(&buf);
11111 Self::arbitrary(&mut unstructured).unwrap_or_default()
11112 }
11113}
11114impl Default for DISTANCE_SENSOR_DATA {
11115 fn default() -> Self {
11116 Self::DEFAULT.clone()
11117 }
11118}
11119impl MessageData for DISTANCE_SENSOR_DATA {
11120 type Message = MavMessage;
11121 const ID: u32 = 132u32;
11122 const NAME: &'static str = "DISTANCE_SENSOR";
11123 const EXTRA_CRC: u8 = 85u8;
11124 const ENCODED_LEN: usize = 39usize;
11125 fn deser(
11126 _version: MavlinkVersion,
11127 __input: &[u8],
11128 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11129 let avail_len = __input.len();
11130 let mut payload_buf = [0; Self::ENCODED_LEN];
11131 let mut buf = if avail_len < Self::ENCODED_LEN {
11132 payload_buf[0..avail_len].copy_from_slice(__input);
11133 Bytes::new(&payload_buf)
11134 } else {
11135 Bytes::new(__input)
11136 };
11137 let mut __struct = Self::default();
11138 __struct.time_boot_ms = buf.get_u32_le();
11139 __struct.min_distance = buf.get_u16_le();
11140 __struct.max_distance = buf.get_u16_le();
11141 __struct.current_distance = buf.get_u16_le();
11142 let tmp = buf.get_u8();
11143 __struct.mavtype =
11144 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11145 enum_type: "MavDistanceSensor",
11146 value: tmp as u32,
11147 })?;
11148 __struct.id = buf.get_u8();
11149 let tmp = buf.get_u8();
11150 __struct.orientation =
11151 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11152 enum_type: "MavSensorOrientation",
11153 value: tmp as u32,
11154 })?;
11155 __struct.covariance = buf.get_u8();
11156 __struct.horizontal_fov = buf.get_f32_le();
11157 __struct.vertical_fov = buf.get_f32_le();
11158 for v in &mut __struct.quaternion {
11159 let val = buf.get_f32_le();
11160 *v = val;
11161 }
11162 __struct.signal_quality = buf.get_u8();
11163 Ok(__struct)
11164 }
11165 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11166 let mut __tmp = BytesMut::new(bytes);
11167 #[allow(clippy::absurd_extreme_comparisons)]
11168 #[allow(unused_comparisons)]
11169 if __tmp.remaining() < Self::ENCODED_LEN {
11170 panic!(
11171 "buffer is too small (need {} bytes, but got {})",
11172 Self::ENCODED_LEN,
11173 __tmp.remaining(),
11174 )
11175 }
11176 __tmp.put_u32_le(self.time_boot_ms);
11177 __tmp.put_u16_le(self.min_distance);
11178 __tmp.put_u16_le(self.max_distance);
11179 __tmp.put_u16_le(self.current_distance);
11180 __tmp.put_u8(self.mavtype as u8);
11181 __tmp.put_u8(self.id);
11182 __tmp.put_u8(self.orientation as u8);
11183 __tmp.put_u8(self.covariance);
11184 if matches!(version, MavlinkVersion::V2) {
11185 __tmp.put_f32_le(self.horizontal_fov);
11186 __tmp.put_f32_le(self.vertical_fov);
11187 for val in &self.quaternion {
11188 __tmp.put_f32_le(*val);
11189 }
11190 __tmp.put_u8(self.signal_quality);
11191 let len = __tmp.len();
11192 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11193 } else {
11194 __tmp.len()
11195 }
11196 }
11197}
11198#[doc = "EFI status output."]
11199#[doc = ""]
11200#[doc = "ID: 225"]
11201#[derive(Debug, Clone, PartialEq)]
11202#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11204pub struct EFI_STATUS_DATA {
11205 #[doc = "ECU index"]
11206 pub ecu_index: f32,
11207 #[doc = "RPM"]
11208 pub rpm: f32,
11209 #[doc = "Fuel consumed"]
11210 pub fuel_consumed: f32,
11211 #[doc = "Fuel flow rate"]
11212 pub fuel_flow: f32,
11213 #[doc = "Engine load"]
11214 pub engine_load: f32,
11215 #[doc = "Throttle position"]
11216 pub throttle_position: f32,
11217 #[doc = "Spark dwell time"]
11218 pub spark_dwell_time: f32,
11219 #[doc = "Barometric pressure"]
11220 pub barometric_pressure: f32,
11221 #[doc = "Intake manifold pressure("]
11222 pub intake_manifold_pressure: f32,
11223 #[doc = "Intake manifold temperature"]
11224 pub intake_manifold_temperature: f32,
11225 #[doc = "Cylinder head temperature"]
11226 pub cylinder_head_temperature: f32,
11227 #[doc = "Ignition timing (Crank angle degrees)"]
11228 pub ignition_timing: f32,
11229 #[doc = "Injection time"]
11230 pub injection_time: f32,
11231 #[doc = "Exhaust gas temperature"]
11232 pub exhaust_gas_temperature: f32,
11233 #[doc = "Output throttle"]
11234 pub throttle_out: f32,
11235 #[doc = "Pressure/temperature compensation"]
11236 pub pt_compensation: f32,
11237 #[doc = "EFI health status"]
11238 pub health: u8,
11239 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
11240 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11241 pub ignition_voltage: f32,
11242 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
11243 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11244 pub fuel_pressure: f32,
11245}
11246impl EFI_STATUS_DATA {
11247 pub const ENCODED_LEN: usize = 73usize;
11248 pub const DEFAULT: Self = Self {
11249 ecu_index: 0.0_f32,
11250 rpm: 0.0_f32,
11251 fuel_consumed: 0.0_f32,
11252 fuel_flow: 0.0_f32,
11253 engine_load: 0.0_f32,
11254 throttle_position: 0.0_f32,
11255 spark_dwell_time: 0.0_f32,
11256 barometric_pressure: 0.0_f32,
11257 intake_manifold_pressure: 0.0_f32,
11258 intake_manifold_temperature: 0.0_f32,
11259 cylinder_head_temperature: 0.0_f32,
11260 ignition_timing: 0.0_f32,
11261 injection_time: 0.0_f32,
11262 exhaust_gas_temperature: 0.0_f32,
11263 throttle_out: 0.0_f32,
11264 pt_compensation: 0.0_f32,
11265 health: 0_u8,
11266 ignition_voltage: 0.0_f32,
11267 fuel_pressure: 0.0_f32,
11268 };
11269 #[cfg(feature = "arbitrary")]
11270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11271 use arbitrary::{Arbitrary, Unstructured};
11272 let mut buf = [0u8; 1024];
11273 rng.fill_bytes(&mut buf);
11274 let mut unstructured = Unstructured::new(&buf);
11275 Self::arbitrary(&mut unstructured).unwrap_or_default()
11276 }
11277}
11278impl Default for EFI_STATUS_DATA {
11279 fn default() -> Self {
11280 Self::DEFAULT.clone()
11281 }
11282}
11283impl MessageData for EFI_STATUS_DATA {
11284 type Message = MavMessage;
11285 const ID: u32 = 225u32;
11286 const NAME: &'static str = "EFI_STATUS";
11287 const EXTRA_CRC: u8 = 208u8;
11288 const ENCODED_LEN: usize = 73usize;
11289 fn deser(
11290 _version: MavlinkVersion,
11291 __input: &[u8],
11292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11293 let avail_len = __input.len();
11294 let mut payload_buf = [0; Self::ENCODED_LEN];
11295 let mut buf = if avail_len < Self::ENCODED_LEN {
11296 payload_buf[0..avail_len].copy_from_slice(__input);
11297 Bytes::new(&payload_buf)
11298 } else {
11299 Bytes::new(__input)
11300 };
11301 let mut __struct = Self::default();
11302 __struct.ecu_index = buf.get_f32_le();
11303 __struct.rpm = buf.get_f32_le();
11304 __struct.fuel_consumed = buf.get_f32_le();
11305 __struct.fuel_flow = buf.get_f32_le();
11306 __struct.engine_load = buf.get_f32_le();
11307 __struct.throttle_position = buf.get_f32_le();
11308 __struct.spark_dwell_time = buf.get_f32_le();
11309 __struct.barometric_pressure = buf.get_f32_le();
11310 __struct.intake_manifold_pressure = buf.get_f32_le();
11311 __struct.intake_manifold_temperature = buf.get_f32_le();
11312 __struct.cylinder_head_temperature = buf.get_f32_le();
11313 __struct.ignition_timing = buf.get_f32_le();
11314 __struct.injection_time = buf.get_f32_le();
11315 __struct.exhaust_gas_temperature = buf.get_f32_le();
11316 __struct.throttle_out = buf.get_f32_le();
11317 __struct.pt_compensation = buf.get_f32_le();
11318 __struct.health = buf.get_u8();
11319 __struct.ignition_voltage = buf.get_f32_le();
11320 __struct.fuel_pressure = buf.get_f32_le();
11321 Ok(__struct)
11322 }
11323 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11324 let mut __tmp = BytesMut::new(bytes);
11325 #[allow(clippy::absurd_extreme_comparisons)]
11326 #[allow(unused_comparisons)]
11327 if __tmp.remaining() < Self::ENCODED_LEN {
11328 panic!(
11329 "buffer is too small (need {} bytes, but got {})",
11330 Self::ENCODED_LEN,
11331 __tmp.remaining(),
11332 )
11333 }
11334 __tmp.put_f32_le(self.ecu_index);
11335 __tmp.put_f32_le(self.rpm);
11336 __tmp.put_f32_le(self.fuel_consumed);
11337 __tmp.put_f32_le(self.fuel_flow);
11338 __tmp.put_f32_le(self.engine_load);
11339 __tmp.put_f32_le(self.throttle_position);
11340 __tmp.put_f32_le(self.spark_dwell_time);
11341 __tmp.put_f32_le(self.barometric_pressure);
11342 __tmp.put_f32_le(self.intake_manifold_pressure);
11343 __tmp.put_f32_le(self.intake_manifold_temperature);
11344 __tmp.put_f32_le(self.cylinder_head_temperature);
11345 __tmp.put_f32_le(self.ignition_timing);
11346 __tmp.put_f32_le(self.injection_time);
11347 __tmp.put_f32_le(self.exhaust_gas_temperature);
11348 __tmp.put_f32_le(self.throttle_out);
11349 __tmp.put_f32_le(self.pt_compensation);
11350 __tmp.put_u8(self.health);
11351 if matches!(version, MavlinkVersion::V2) {
11352 __tmp.put_f32_le(self.ignition_voltage);
11353 __tmp.put_f32_le(self.fuel_pressure);
11354 let len = __tmp.len();
11355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11356 } else {
11357 __tmp.len()
11358 }
11359 }
11360}
11361#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11362#[doc = ""]
11363#[doc = "ID: 131"]
11364#[derive(Debug, Clone, PartialEq)]
11365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11367pub struct ENCAPSULATED_DATA_DATA {
11368 #[doc = "sequence number (starting with 0 on every transmission)"]
11369 pub seqnr: u16,
11370 #[doc = "image data bytes"]
11371 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11372 pub data: [u8; 253],
11373}
11374impl ENCAPSULATED_DATA_DATA {
11375 pub const ENCODED_LEN: usize = 255usize;
11376 pub const DEFAULT: Self = Self {
11377 seqnr: 0_u16,
11378 data: [0_u8; 253usize],
11379 };
11380 #[cfg(feature = "arbitrary")]
11381 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11382 use arbitrary::{Arbitrary, Unstructured};
11383 let mut buf = [0u8; 1024];
11384 rng.fill_bytes(&mut buf);
11385 let mut unstructured = Unstructured::new(&buf);
11386 Self::arbitrary(&mut unstructured).unwrap_or_default()
11387 }
11388}
11389impl Default for ENCAPSULATED_DATA_DATA {
11390 fn default() -> Self {
11391 Self::DEFAULT.clone()
11392 }
11393}
11394impl MessageData for ENCAPSULATED_DATA_DATA {
11395 type Message = MavMessage;
11396 const ID: u32 = 131u32;
11397 const NAME: &'static str = "ENCAPSULATED_DATA";
11398 const EXTRA_CRC: u8 = 223u8;
11399 const ENCODED_LEN: usize = 255usize;
11400 fn deser(
11401 _version: MavlinkVersion,
11402 __input: &[u8],
11403 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11404 let avail_len = __input.len();
11405 let mut payload_buf = [0; Self::ENCODED_LEN];
11406 let mut buf = if avail_len < Self::ENCODED_LEN {
11407 payload_buf[0..avail_len].copy_from_slice(__input);
11408 Bytes::new(&payload_buf)
11409 } else {
11410 Bytes::new(__input)
11411 };
11412 let mut __struct = Self::default();
11413 __struct.seqnr = buf.get_u16_le();
11414 for v in &mut __struct.data {
11415 let val = buf.get_u8();
11416 *v = val;
11417 }
11418 Ok(__struct)
11419 }
11420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11421 let mut __tmp = BytesMut::new(bytes);
11422 #[allow(clippy::absurd_extreme_comparisons)]
11423 #[allow(unused_comparisons)]
11424 if __tmp.remaining() < Self::ENCODED_LEN {
11425 panic!(
11426 "buffer is too small (need {} bytes, but got {})",
11427 Self::ENCODED_LEN,
11428 __tmp.remaining(),
11429 )
11430 }
11431 __tmp.put_u16_le(self.seqnr);
11432 for val in &self.data {
11433 __tmp.put_u8(*val);
11434 }
11435 if matches!(version, MavlinkVersion::V2) {
11436 let len = __tmp.len();
11437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11438 } else {
11439 __tmp.len()
11440 }
11441 }
11442}
11443#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11444#[doc = ""]
11445#[doc = "ID: 290"]
11446#[derive(Debug, Clone, PartialEq)]
11447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11449pub struct ESC_INFO_DATA {
11450 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11451 pub time_usec: u64,
11452 #[doc = "Number of reported errors by each ESC since boot."]
11453 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11454 pub error_count: [u32; 4],
11455 #[doc = "Counter of data packets received."]
11456 pub counter: u16,
11457 #[doc = "Bitmap of ESC failure flags."]
11458 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11459 pub failure_flags: [u16; 4],
11460 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11461 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11462 pub temperature: [i16; 4],
11463 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11464 pub index: u8,
11465 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11466 pub count: u8,
11467 #[doc = "Connection type protocol for all ESC."]
11468 pub connection_type: EscConnectionType,
11469 #[doc = "Information regarding online/offline status of each ESC."]
11470 pub info: u8,
11471}
11472impl ESC_INFO_DATA {
11473 pub const ENCODED_LEN: usize = 46usize;
11474 pub const DEFAULT: Self = Self {
11475 time_usec: 0_u64,
11476 error_count: [0_u32; 4usize],
11477 counter: 0_u16,
11478 failure_flags: [0_u16; 4usize],
11479 temperature: [0_i16; 4usize],
11480 index: 0_u8,
11481 count: 0_u8,
11482 connection_type: EscConnectionType::DEFAULT,
11483 info: 0_u8,
11484 };
11485 #[cfg(feature = "arbitrary")]
11486 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11487 use arbitrary::{Arbitrary, Unstructured};
11488 let mut buf = [0u8; 1024];
11489 rng.fill_bytes(&mut buf);
11490 let mut unstructured = Unstructured::new(&buf);
11491 Self::arbitrary(&mut unstructured).unwrap_or_default()
11492 }
11493}
11494impl Default for ESC_INFO_DATA {
11495 fn default() -> Self {
11496 Self::DEFAULT.clone()
11497 }
11498}
11499impl MessageData for ESC_INFO_DATA {
11500 type Message = MavMessage;
11501 const ID: u32 = 290u32;
11502 const NAME: &'static str = "ESC_INFO";
11503 const EXTRA_CRC: u8 = 251u8;
11504 const ENCODED_LEN: usize = 46usize;
11505 fn deser(
11506 _version: MavlinkVersion,
11507 __input: &[u8],
11508 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11509 let avail_len = __input.len();
11510 let mut payload_buf = [0; Self::ENCODED_LEN];
11511 let mut buf = if avail_len < Self::ENCODED_LEN {
11512 payload_buf[0..avail_len].copy_from_slice(__input);
11513 Bytes::new(&payload_buf)
11514 } else {
11515 Bytes::new(__input)
11516 };
11517 let mut __struct = Self::default();
11518 __struct.time_usec = buf.get_u64_le();
11519 for v in &mut __struct.error_count {
11520 let val = buf.get_u32_le();
11521 *v = val;
11522 }
11523 __struct.counter = buf.get_u16_le();
11524 for v in &mut __struct.failure_flags {
11525 let val = buf.get_u16_le();
11526 *v = val;
11527 }
11528 for v in &mut __struct.temperature {
11529 let val = buf.get_i16_le();
11530 *v = val;
11531 }
11532 __struct.index = buf.get_u8();
11533 __struct.count = buf.get_u8();
11534 let tmp = buf.get_u8();
11535 __struct.connection_type =
11536 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11537 enum_type: "EscConnectionType",
11538 value: tmp as u32,
11539 })?;
11540 __struct.info = buf.get_u8();
11541 Ok(__struct)
11542 }
11543 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11544 let mut __tmp = BytesMut::new(bytes);
11545 #[allow(clippy::absurd_extreme_comparisons)]
11546 #[allow(unused_comparisons)]
11547 if __tmp.remaining() < Self::ENCODED_LEN {
11548 panic!(
11549 "buffer is too small (need {} bytes, but got {})",
11550 Self::ENCODED_LEN,
11551 __tmp.remaining(),
11552 )
11553 }
11554 __tmp.put_u64_le(self.time_usec);
11555 for val in &self.error_count {
11556 __tmp.put_u32_le(*val);
11557 }
11558 __tmp.put_u16_le(self.counter);
11559 for val in &self.failure_flags {
11560 __tmp.put_u16_le(*val);
11561 }
11562 for val in &self.temperature {
11563 __tmp.put_i16_le(*val);
11564 }
11565 __tmp.put_u8(self.index);
11566 __tmp.put_u8(self.count);
11567 __tmp.put_u8(self.connection_type as u8);
11568 __tmp.put_u8(self.info);
11569 if matches!(version, MavlinkVersion::V2) {
11570 let len = __tmp.len();
11571 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11572 } else {
11573 __tmp.len()
11574 }
11575 }
11576}
11577#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11578#[doc = ""]
11579#[doc = "ID: 291"]
11580#[derive(Debug, Clone, PartialEq)]
11581#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11583pub struct ESC_STATUS_DATA {
11584 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11585 pub time_usec: u64,
11586 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11587 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11588 pub rpm: [i32; 4],
11589 #[doc = "Voltage measured from each ESC."]
11590 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11591 pub voltage: [f32; 4],
11592 #[doc = "Current measured from each ESC."]
11593 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11594 pub current: [f32; 4],
11595 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11596 pub index: u8,
11597}
11598impl ESC_STATUS_DATA {
11599 pub const ENCODED_LEN: usize = 57usize;
11600 pub const DEFAULT: Self = Self {
11601 time_usec: 0_u64,
11602 rpm: [0_i32; 4usize],
11603 voltage: [0.0_f32; 4usize],
11604 current: [0.0_f32; 4usize],
11605 index: 0_u8,
11606 };
11607 #[cfg(feature = "arbitrary")]
11608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11609 use arbitrary::{Arbitrary, Unstructured};
11610 let mut buf = [0u8; 1024];
11611 rng.fill_bytes(&mut buf);
11612 let mut unstructured = Unstructured::new(&buf);
11613 Self::arbitrary(&mut unstructured).unwrap_or_default()
11614 }
11615}
11616impl Default for ESC_STATUS_DATA {
11617 fn default() -> Self {
11618 Self::DEFAULT.clone()
11619 }
11620}
11621impl MessageData for ESC_STATUS_DATA {
11622 type Message = MavMessage;
11623 const ID: u32 = 291u32;
11624 const NAME: &'static str = "ESC_STATUS";
11625 const EXTRA_CRC: u8 = 10u8;
11626 const ENCODED_LEN: usize = 57usize;
11627 fn deser(
11628 _version: MavlinkVersion,
11629 __input: &[u8],
11630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11631 let avail_len = __input.len();
11632 let mut payload_buf = [0; Self::ENCODED_LEN];
11633 let mut buf = if avail_len < Self::ENCODED_LEN {
11634 payload_buf[0..avail_len].copy_from_slice(__input);
11635 Bytes::new(&payload_buf)
11636 } else {
11637 Bytes::new(__input)
11638 };
11639 let mut __struct = Self::default();
11640 __struct.time_usec = buf.get_u64_le();
11641 for v in &mut __struct.rpm {
11642 let val = buf.get_i32_le();
11643 *v = val;
11644 }
11645 for v in &mut __struct.voltage {
11646 let val = buf.get_f32_le();
11647 *v = val;
11648 }
11649 for v in &mut __struct.current {
11650 let val = buf.get_f32_le();
11651 *v = val;
11652 }
11653 __struct.index = buf.get_u8();
11654 Ok(__struct)
11655 }
11656 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11657 let mut __tmp = BytesMut::new(bytes);
11658 #[allow(clippy::absurd_extreme_comparisons)]
11659 #[allow(unused_comparisons)]
11660 if __tmp.remaining() < Self::ENCODED_LEN {
11661 panic!(
11662 "buffer is too small (need {} bytes, but got {})",
11663 Self::ENCODED_LEN,
11664 __tmp.remaining(),
11665 )
11666 }
11667 __tmp.put_u64_le(self.time_usec);
11668 for val in &self.rpm {
11669 __tmp.put_i32_le(*val);
11670 }
11671 for val in &self.voltage {
11672 __tmp.put_f32_le(*val);
11673 }
11674 for val in &self.current {
11675 __tmp.put_f32_le(*val);
11676 }
11677 __tmp.put_u8(self.index);
11678 if matches!(version, MavlinkVersion::V2) {
11679 let len = __tmp.len();
11680 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11681 } else {
11682 __tmp.len()
11683 }
11684 }
11685}
11686#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11687#[doc = ""]
11688#[doc = "ID: 230"]
11689#[derive(Debug, Clone, PartialEq)]
11690#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11692pub struct ESTIMATOR_STATUS_DATA {
11693 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11694 pub time_usec: u64,
11695 #[doc = "Velocity innovation test ratio"]
11696 pub vel_ratio: f32,
11697 #[doc = "Horizontal position innovation test ratio"]
11698 pub pos_horiz_ratio: f32,
11699 #[doc = "Vertical position innovation test ratio"]
11700 pub pos_vert_ratio: f32,
11701 #[doc = "Magnetometer innovation test ratio"]
11702 pub mag_ratio: f32,
11703 #[doc = "Height above terrain innovation test ratio"]
11704 pub hagl_ratio: f32,
11705 #[doc = "True airspeed innovation test ratio"]
11706 pub tas_ratio: f32,
11707 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11708 pub pos_horiz_accuracy: f32,
11709 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11710 pub pos_vert_accuracy: f32,
11711 #[doc = "Bitmap indicating which EKF outputs are valid."]
11712 pub flags: EstimatorStatusFlags,
11713}
11714impl ESTIMATOR_STATUS_DATA {
11715 pub const ENCODED_LEN: usize = 42usize;
11716 pub const DEFAULT: Self = Self {
11717 time_usec: 0_u64,
11718 vel_ratio: 0.0_f32,
11719 pos_horiz_ratio: 0.0_f32,
11720 pos_vert_ratio: 0.0_f32,
11721 mag_ratio: 0.0_f32,
11722 hagl_ratio: 0.0_f32,
11723 tas_ratio: 0.0_f32,
11724 pos_horiz_accuracy: 0.0_f32,
11725 pos_vert_accuracy: 0.0_f32,
11726 flags: EstimatorStatusFlags::DEFAULT,
11727 };
11728 #[cfg(feature = "arbitrary")]
11729 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11730 use arbitrary::{Arbitrary, Unstructured};
11731 let mut buf = [0u8; 1024];
11732 rng.fill_bytes(&mut buf);
11733 let mut unstructured = Unstructured::new(&buf);
11734 Self::arbitrary(&mut unstructured).unwrap_or_default()
11735 }
11736}
11737impl Default for ESTIMATOR_STATUS_DATA {
11738 fn default() -> Self {
11739 Self::DEFAULT.clone()
11740 }
11741}
11742impl MessageData for ESTIMATOR_STATUS_DATA {
11743 type Message = MavMessage;
11744 const ID: u32 = 230u32;
11745 const NAME: &'static str = "ESTIMATOR_STATUS";
11746 const EXTRA_CRC: u8 = 163u8;
11747 const ENCODED_LEN: usize = 42usize;
11748 fn deser(
11749 _version: MavlinkVersion,
11750 __input: &[u8],
11751 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11752 let avail_len = __input.len();
11753 let mut payload_buf = [0; Self::ENCODED_LEN];
11754 let mut buf = if avail_len < Self::ENCODED_LEN {
11755 payload_buf[0..avail_len].copy_from_slice(__input);
11756 Bytes::new(&payload_buf)
11757 } else {
11758 Bytes::new(__input)
11759 };
11760 let mut __struct = Self::default();
11761 __struct.time_usec = buf.get_u64_le();
11762 __struct.vel_ratio = buf.get_f32_le();
11763 __struct.pos_horiz_ratio = buf.get_f32_le();
11764 __struct.pos_vert_ratio = buf.get_f32_le();
11765 __struct.mag_ratio = buf.get_f32_le();
11766 __struct.hagl_ratio = buf.get_f32_le();
11767 __struct.tas_ratio = buf.get_f32_le();
11768 __struct.pos_horiz_accuracy = buf.get_f32_le();
11769 __struct.pos_vert_accuracy = buf.get_f32_le();
11770 let tmp = buf.get_u16_le();
11771 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11772 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11773 flag_type: "EstimatorStatusFlags",
11774 value: tmp as u32,
11775 })?;
11776 Ok(__struct)
11777 }
11778 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11779 let mut __tmp = BytesMut::new(bytes);
11780 #[allow(clippy::absurd_extreme_comparisons)]
11781 #[allow(unused_comparisons)]
11782 if __tmp.remaining() < Self::ENCODED_LEN {
11783 panic!(
11784 "buffer is too small (need {} bytes, but got {})",
11785 Self::ENCODED_LEN,
11786 __tmp.remaining(),
11787 )
11788 }
11789 __tmp.put_u64_le(self.time_usec);
11790 __tmp.put_f32_le(self.vel_ratio);
11791 __tmp.put_f32_le(self.pos_horiz_ratio);
11792 __tmp.put_f32_le(self.pos_vert_ratio);
11793 __tmp.put_f32_le(self.mag_ratio);
11794 __tmp.put_f32_le(self.hagl_ratio);
11795 __tmp.put_f32_le(self.tas_ratio);
11796 __tmp.put_f32_le(self.pos_horiz_accuracy);
11797 __tmp.put_f32_le(self.pos_vert_accuracy);
11798 __tmp.put_u16_le(self.flags.bits());
11799 if matches!(version, MavlinkVersion::V2) {
11800 let len = __tmp.len();
11801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11802 } else {
11803 __tmp.len()
11804 }
11805 }
11806}
11807#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11808#[doc = ""]
11809#[doc = "ID: 410"]
11810#[derive(Debug, Clone, PartialEq)]
11811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11813pub struct EVENT_DATA {
11814 #[doc = "Event ID (as defined in the component metadata)"]
11815 pub id: u32,
11816 #[doc = "Timestamp (time since system boot when the event happened)."]
11817 pub event_time_boot_ms: u32,
11818 #[doc = "Sequence number."]
11819 pub sequence: u16,
11820 #[doc = "Component ID"]
11821 pub destination_component: u8,
11822 #[doc = "System ID"]
11823 pub destination_system: u8,
11824 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11825 pub log_levels: u8,
11826 #[doc = "Arguments (depend on event ID)."]
11827 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11828 pub arguments: [u8; 40],
11829}
11830impl EVENT_DATA {
11831 pub const ENCODED_LEN: usize = 53usize;
11832 pub const DEFAULT: Self = Self {
11833 id: 0_u32,
11834 event_time_boot_ms: 0_u32,
11835 sequence: 0_u16,
11836 destination_component: 0_u8,
11837 destination_system: 0_u8,
11838 log_levels: 0_u8,
11839 arguments: [0_u8; 40usize],
11840 };
11841 #[cfg(feature = "arbitrary")]
11842 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11843 use arbitrary::{Arbitrary, Unstructured};
11844 let mut buf = [0u8; 1024];
11845 rng.fill_bytes(&mut buf);
11846 let mut unstructured = Unstructured::new(&buf);
11847 Self::arbitrary(&mut unstructured).unwrap_or_default()
11848 }
11849}
11850impl Default for EVENT_DATA {
11851 fn default() -> Self {
11852 Self::DEFAULT.clone()
11853 }
11854}
11855impl MessageData for EVENT_DATA {
11856 type Message = MavMessage;
11857 const ID: u32 = 410u32;
11858 const NAME: &'static str = "EVENT";
11859 const EXTRA_CRC: u8 = 160u8;
11860 const ENCODED_LEN: usize = 53usize;
11861 fn deser(
11862 _version: MavlinkVersion,
11863 __input: &[u8],
11864 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11865 let avail_len = __input.len();
11866 let mut payload_buf = [0; Self::ENCODED_LEN];
11867 let mut buf = if avail_len < Self::ENCODED_LEN {
11868 payload_buf[0..avail_len].copy_from_slice(__input);
11869 Bytes::new(&payload_buf)
11870 } else {
11871 Bytes::new(__input)
11872 };
11873 let mut __struct = Self::default();
11874 __struct.id = buf.get_u32_le();
11875 __struct.event_time_boot_ms = buf.get_u32_le();
11876 __struct.sequence = buf.get_u16_le();
11877 __struct.destination_component = buf.get_u8();
11878 __struct.destination_system = buf.get_u8();
11879 __struct.log_levels = buf.get_u8();
11880 for v in &mut __struct.arguments {
11881 let val = buf.get_u8();
11882 *v = val;
11883 }
11884 Ok(__struct)
11885 }
11886 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11887 let mut __tmp = BytesMut::new(bytes);
11888 #[allow(clippy::absurd_extreme_comparisons)]
11889 #[allow(unused_comparisons)]
11890 if __tmp.remaining() < Self::ENCODED_LEN {
11891 panic!(
11892 "buffer is too small (need {} bytes, but got {})",
11893 Self::ENCODED_LEN,
11894 __tmp.remaining(),
11895 )
11896 }
11897 __tmp.put_u32_le(self.id);
11898 __tmp.put_u32_le(self.event_time_boot_ms);
11899 __tmp.put_u16_le(self.sequence);
11900 __tmp.put_u8(self.destination_component);
11901 __tmp.put_u8(self.destination_system);
11902 __tmp.put_u8(self.log_levels);
11903 for val in &self.arguments {
11904 __tmp.put_u8(*val);
11905 }
11906 if matches!(version, MavlinkVersion::V2) {
11907 let len = __tmp.len();
11908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11909 } else {
11910 __tmp.len()
11911 }
11912 }
11913}
11914#[doc = "Provides state for additional features."]
11915#[doc = ""]
11916#[doc = "ID: 245"]
11917#[derive(Debug, Clone, PartialEq)]
11918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11920pub struct EXTENDED_SYS_STATE_DATA {
11921 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11922 pub vtol_state: MavVtolState,
11923 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11924 pub landed_state: MavLandedState,
11925}
11926impl EXTENDED_SYS_STATE_DATA {
11927 pub const ENCODED_LEN: usize = 2usize;
11928 pub const DEFAULT: Self = Self {
11929 vtol_state: MavVtolState::DEFAULT,
11930 landed_state: MavLandedState::DEFAULT,
11931 };
11932 #[cfg(feature = "arbitrary")]
11933 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11934 use arbitrary::{Arbitrary, Unstructured};
11935 let mut buf = [0u8; 1024];
11936 rng.fill_bytes(&mut buf);
11937 let mut unstructured = Unstructured::new(&buf);
11938 Self::arbitrary(&mut unstructured).unwrap_or_default()
11939 }
11940}
11941impl Default for EXTENDED_SYS_STATE_DATA {
11942 fn default() -> Self {
11943 Self::DEFAULT.clone()
11944 }
11945}
11946impl MessageData for EXTENDED_SYS_STATE_DATA {
11947 type Message = MavMessage;
11948 const ID: u32 = 245u32;
11949 const NAME: &'static str = "EXTENDED_SYS_STATE";
11950 const EXTRA_CRC: u8 = 130u8;
11951 const ENCODED_LEN: usize = 2usize;
11952 fn deser(
11953 _version: MavlinkVersion,
11954 __input: &[u8],
11955 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11956 let avail_len = __input.len();
11957 let mut payload_buf = [0; Self::ENCODED_LEN];
11958 let mut buf = if avail_len < Self::ENCODED_LEN {
11959 payload_buf[0..avail_len].copy_from_slice(__input);
11960 Bytes::new(&payload_buf)
11961 } else {
11962 Bytes::new(__input)
11963 };
11964 let mut __struct = Self::default();
11965 let tmp = buf.get_u8();
11966 __struct.vtol_state =
11967 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11968 enum_type: "MavVtolState",
11969 value: tmp as u32,
11970 })?;
11971 let tmp = buf.get_u8();
11972 __struct.landed_state =
11973 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11974 enum_type: "MavLandedState",
11975 value: tmp as u32,
11976 })?;
11977 Ok(__struct)
11978 }
11979 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11980 let mut __tmp = BytesMut::new(bytes);
11981 #[allow(clippy::absurd_extreme_comparisons)]
11982 #[allow(unused_comparisons)]
11983 if __tmp.remaining() < Self::ENCODED_LEN {
11984 panic!(
11985 "buffer is too small (need {} bytes, but got {})",
11986 Self::ENCODED_LEN,
11987 __tmp.remaining(),
11988 )
11989 }
11990 __tmp.put_u8(self.vtol_state as u8);
11991 __tmp.put_u8(self.landed_state as u8);
11992 if matches!(version, MavlinkVersion::V2) {
11993 let len = __tmp.len();
11994 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11995 } else {
11996 __tmp.len()
11997 }
11998 }
11999}
12000#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
12001#[doc = ""]
12002#[doc = "ID: 162"]
12003#[derive(Debug, Clone, PartialEq)]
12004#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12005#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12006pub struct FENCE_STATUS_DATA {
12007 #[doc = "Time (since boot) of last breach."]
12008 pub breach_time: u32,
12009 #[doc = "Number of fence breaches."]
12010 pub breach_count: u16,
12011 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
12012 pub breach_status: u8,
12013 #[doc = "Last breach type."]
12014 pub breach_type: FenceBreach,
12015 #[doc = "Active action to prevent fence breach"]
12016 #[cfg_attr(feature = "serde", serde(default))]
12017 pub breach_mitigation: FenceMitigate,
12018}
12019impl FENCE_STATUS_DATA {
12020 pub const ENCODED_LEN: usize = 9usize;
12021 pub const DEFAULT: Self = Self {
12022 breach_time: 0_u32,
12023 breach_count: 0_u16,
12024 breach_status: 0_u8,
12025 breach_type: FenceBreach::DEFAULT,
12026 breach_mitigation: FenceMitigate::DEFAULT,
12027 };
12028 #[cfg(feature = "arbitrary")]
12029 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12030 use arbitrary::{Arbitrary, Unstructured};
12031 let mut buf = [0u8; 1024];
12032 rng.fill_bytes(&mut buf);
12033 let mut unstructured = Unstructured::new(&buf);
12034 Self::arbitrary(&mut unstructured).unwrap_or_default()
12035 }
12036}
12037impl Default for FENCE_STATUS_DATA {
12038 fn default() -> Self {
12039 Self::DEFAULT.clone()
12040 }
12041}
12042impl MessageData for FENCE_STATUS_DATA {
12043 type Message = MavMessage;
12044 const ID: u32 = 162u32;
12045 const NAME: &'static str = "FENCE_STATUS";
12046 const EXTRA_CRC: u8 = 189u8;
12047 const ENCODED_LEN: usize = 9usize;
12048 fn deser(
12049 _version: MavlinkVersion,
12050 __input: &[u8],
12051 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12052 let avail_len = __input.len();
12053 let mut payload_buf = [0; Self::ENCODED_LEN];
12054 let mut buf = if avail_len < Self::ENCODED_LEN {
12055 payload_buf[0..avail_len].copy_from_slice(__input);
12056 Bytes::new(&payload_buf)
12057 } else {
12058 Bytes::new(__input)
12059 };
12060 let mut __struct = Self::default();
12061 __struct.breach_time = buf.get_u32_le();
12062 __struct.breach_count = buf.get_u16_le();
12063 __struct.breach_status = buf.get_u8();
12064 let tmp = buf.get_u8();
12065 __struct.breach_type =
12066 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12067 enum_type: "FenceBreach",
12068 value: tmp as u32,
12069 })?;
12070 let tmp = buf.get_u8();
12071 __struct.breach_mitigation =
12072 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12073 enum_type: "FenceMitigate",
12074 value: tmp as u32,
12075 })?;
12076 Ok(__struct)
12077 }
12078 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12079 let mut __tmp = BytesMut::new(bytes);
12080 #[allow(clippy::absurd_extreme_comparisons)]
12081 #[allow(unused_comparisons)]
12082 if __tmp.remaining() < Self::ENCODED_LEN {
12083 panic!(
12084 "buffer is too small (need {} bytes, but got {})",
12085 Self::ENCODED_LEN,
12086 __tmp.remaining(),
12087 )
12088 }
12089 __tmp.put_u32_le(self.breach_time);
12090 __tmp.put_u16_le(self.breach_count);
12091 __tmp.put_u8(self.breach_status);
12092 __tmp.put_u8(self.breach_type as u8);
12093 if matches!(version, MavlinkVersion::V2) {
12094 __tmp.put_u8(self.breach_mitigation as u8);
12095 let len = __tmp.len();
12096 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12097 } else {
12098 __tmp.len()
12099 }
12100 }
12101}
12102#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
12103#[doc = ""]
12104#[doc = "ID: 110"]
12105#[derive(Debug, Clone, PartialEq)]
12106#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12107#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12108pub struct FILE_TRANSFER_PROTOCOL_DATA {
12109 #[doc = "Network ID (0 for broadcast)"]
12110 pub target_network: u8,
12111 #[doc = "System ID (0 for broadcast)"]
12112 pub target_system: u8,
12113 #[doc = "Component ID (0 for broadcast)"]
12114 pub target_component: u8,
12115 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
12116 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12117 pub payload: [u8; 251],
12118}
12119impl FILE_TRANSFER_PROTOCOL_DATA {
12120 pub const ENCODED_LEN: usize = 254usize;
12121 pub const DEFAULT: Self = Self {
12122 target_network: 0_u8,
12123 target_system: 0_u8,
12124 target_component: 0_u8,
12125 payload: [0_u8; 251usize],
12126 };
12127 #[cfg(feature = "arbitrary")]
12128 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12129 use arbitrary::{Arbitrary, Unstructured};
12130 let mut buf = [0u8; 1024];
12131 rng.fill_bytes(&mut buf);
12132 let mut unstructured = Unstructured::new(&buf);
12133 Self::arbitrary(&mut unstructured).unwrap_or_default()
12134 }
12135}
12136impl Default for FILE_TRANSFER_PROTOCOL_DATA {
12137 fn default() -> Self {
12138 Self::DEFAULT.clone()
12139 }
12140}
12141impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
12142 type Message = MavMessage;
12143 const ID: u32 = 110u32;
12144 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
12145 const EXTRA_CRC: u8 = 84u8;
12146 const ENCODED_LEN: usize = 254usize;
12147 fn deser(
12148 _version: MavlinkVersion,
12149 __input: &[u8],
12150 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12151 let avail_len = __input.len();
12152 let mut payload_buf = [0; Self::ENCODED_LEN];
12153 let mut buf = if avail_len < Self::ENCODED_LEN {
12154 payload_buf[0..avail_len].copy_from_slice(__input);
12155 Bytes::new(&payload_buf)
12156 } else {
12157 Bytes::new(__input)
12158 };
12159 let mut __struct = Self::default();
12160 __struct.target_network = buf.get_u8();
12161 __struct.target_system = buf.get_u8();
12162 __struct.target_component = buf.get_u8();
12163 for v in &mut __struct.payload {
12164 let val = buf.get_u8();
12165 *v = val;
12166 }
12167 Ok(__struct)
12168 }
12169 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12170 let mut __tmp = BytesMut::new(bytes);
12171 #[allow(clippy::absurd_extreme_comparisons)]
12172 #[allow(unused_comparisons)]
12173 if __tmp.remaining() < Self::ENCODED_LEN {
12174 panic!(
12175 "buffer is too small (need {} bytes, but got {})",
12176 Self::ENCODED_LEN,
12177 __tmp.remaining(),
12178 )
12179 }
12180 __tmp.put_u8(self.target_network);
12181 __tmp.put_u8(self.target_system);
12182 __tmp.put_u8(self.target_component);
12183 for val in &self.payload {
12184 __tmp.put_u8(*val);
12185 }
12186 if matches!(version, MavlinkVersion::V2) {
12187 let len = __tmp.len();
12188 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12189 } else {
12190 __tmp.len()
12191 }
12192 }
12193}
12194#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
12195#[doc = ""]
12196#[doc = "ID: 264"]
12197#[derive(Debug, Clone, PartialEq)]
12198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12199#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12200pub struct FLIGHT_INFORMATION_DATA {
12201 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
12202 pub arming_time_utc: u64,
12203 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
12204 pub takeoff_time_utc: u64,
12205 #[doc = "Flight number. Note, field is misnamed UUID."]
12206 pub flight_uuid: u64,
12207 #[doc = "Timestamp (time since system boot)."]
12208 pub time_boot_ms: u32,
12209 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
12210 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12211 pub landing_time: u32,
12212}
12213impl FLIGHT_INFORMATION_DATA {
12214 pub const ENCODED_LEN: usize = 32usize;
12215 pub const DEFAULT: Self = Self {
12216 arming_time_utc: 0_u64,
12217 takeoff_time_utc: 0_u64,
12218 flight_uuid: 0_u64,
12219 time_boot_ms: 0_u32,
12220 landing_time: 0_u32,
12221 };
12222 #[cfg(feature = "arbitrary")]
12223 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12224 use arbitrary::{Arbitrary, Unstructured};
12225 let mut buf = [0u8; 1024];
12226 rng.fill_bytes(&mut buf);
12227 let mut unstructured = Unstructured::new(&buf);
12228 Self::arbitrary(&mut unstructured).unwrap_or_default()
12229 }
12230}
12231impl Default for FLIGHT_INFORMATION_DATA {
12232 fn default() -> Self {
12233 Self::DEFAULT.clone()
12234 }
12235}
12236impl MessageData for FLIGHT_INFORMATION_DATA {
12237 type Message = MavMessage;
12238 const ID: u32 = 264u32;
12239 const NAME: &'static str = "FLIGHT_INFORMATION";
12240 const EXTRA_CRC: u8 = 49u8;
12241 const ENCODED_LEN: usize = 32usize;
12242 fn deser(
12243 _version: MavlinkVersion,
12244 __input: &[u8],
12245 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12246 let avail_len = __input.len();
12247 let mut payload_buf = [0; Self::ENCODED_LEN];
12248 let mut buf = if avail_len < Self::ENCODED_LEN {
12249 payload_buf[0..avail_len].copy_from_slice(__input);
12250 Bytes::new(&payload_buf)
12251 } else {
12252 Bytes::new(__input)
12253 };
12254 let mut __struct = Self::default();
12255 __struct.arming_time_utc = buf.get_u64_le();
12256 __struct.takeoff_time_utc = buf.get_u64_le();
12257 __struct.flight_uuid = buf.get_u64_le();
12258 __struct.time_boot_ms = buf.get_u32_le();
12259 __struct.landing_time = buf.get_u32_le();
12260 Ok(__struct)
12261 }
12262 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12263 let mut __tmp = BytesMut::new(bytes);
12264 #[allow(clippy::absurd_extreme_comparisons)]
12265 #[allow(unused_comparisons)]
12266 if __tmp.remaining() < Self::ENCODED_LEN {
12267 panic!(
12268 "buffer is too small (need {} bytes, but got {})",
12269 Self::ENCODED_LEN,
12270 __tmp.remaining(),
12271 )
12272 }
12273 __tmp.put_u64_le(self.arming_time_utc);
12274 __tmp.put_u64_le(self.takeoff_time_utc);
12275 __tmp.put_u64_le(self.flight_uuid);
12276 __tmp.put_u32_le(self.time_boot_ms);
12277 if matches!(version, MavlinkVersion::V2) {
12278 __tmp.put_u32_le(self.landing_time);
12279 let len = __tmp.len();
12280 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12281 } else {
12282 __tmp.len()
12283 }
12284 }
12285}
12286#[doc = "Current motion information from a designated system."]
12287#[doc = ""]
12288#[doc = "ID: 144"]
12289#[derive(Debug, Clone, PartialEq)]
12290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12292pub struct FOLLOW_TARGET_DATA {
12293 #[doc = "Timestamp (time since system boot)."]
12294 pub timestamp: u64,
12295 #[doc = "button states or switches of a tracker device"]
12296 pub custom_state: u64,
12297 #[doc = "Latitude (WGS84)"]
12298 pub lat: i32,
12299 #[doc = "Longitude (WGS84)"]
12300 pub lon: i32,
12301 #[doc = "Altitude (MSL)"]
12302 pub alt: f32,
12303 #[doc = "target velocity (0,0,0) for unknown"]
12304 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12305 pub vel: [f32; 3],
12306 #[doc = "linear target acceleration (0,0,0) for unknown"]
12307 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12308 pub acc: [f32; 3],
12309 #[doc = "(0 0 0 0 for unknown)"]
12310 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12311 pub attitude_q: [f32; 4],
12312 #[doc = "(0 0 0 for unknown)"]
12313 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12314 pub rates: [f32; 3],
12315 #[doc = "eph epv"]
12316 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12317 pub position_cov: [f32; 3],
12318 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12319 pub est_capabilities: u8,
12320}
12321impl FOLLOW_TARGET_DATA {
12322 pub const ENCODED_LEN: usize = 93usize;
12323 pub const DEFAULT: Self = Self {
12324 timestamp: 0_u64,
12325 custom_state: 0_u64,
12326 lat: 0_i32,
12327 lon: 0_i32,
12328 alt: 0.0_f32,
12329 vel: [0.0_f32; 3usize],
12330 acc: [0.0_f32; 3usize],
12331 attitude_q: [0.0_f32; 4usize],
12332 rates: [0.0_f32; 3usize],
12333 position_cov: [0.0_f32; 3usize],
12334 est_capabilities: 0_u8,
12335 };
12336 #[cfg(feature = "arbitrary")]
12337 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12338 use arbitrary::{Arbitrary, Unstructured};
12339 let mut buf = [0u8; 1024];
12340 rng.fill_bytes(&mut buf);
12341 let mut unstructured = Unstructured::new(&buf);
12342 Self::arbitrary(&mut unstructured).unwrap_or_default()
12343 }
12344}
12345impl Default for FOLLOW_TARGET_DATA {
12346 fn default() -> Self {
12347 Self::DEFAULT.clone()
12348 }
12349}
12350impl MessageData for FOLLOW_TARGET_DATA {
12351 type Message = MavMessage;
12352 const ID: u32 = 144u32;
12353 const NAME: &'static str = "FOLLOW_TARGET";
12354 const EXTRA_CRC: u8 = 127u8;
12355 const ENCODED_LEN: usize = 93usize;
12356 fn deser(
12357 _version: MavlinkVersion,
12358 __input: &[u8],
12359 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12360 let avail_len = __input.len();
12361 let mut payload_buf = [0; Self::ENCODED_LEN];
12362 let mut buf = if avail_len < Self::ENCODED_LEN {
12363 payload_buf[0..avail_len].copy_from_slice(__input);
12364 Bytes::new(&payload_buf)
12365 } else {
12366 Bytes::new(__input)
12367 };
12368 let mut __struct = Self::default();
12369 __struct.timestamp = buf.get_u64_le();
12370 __struct.custom_state = buf.get_u64_le();
12371 __struct.lat = buf.get_i32_le();
12372 __struct.lon = buf.get_i32_le();
12373 __struct.alt = buf.get_f32_le();
12374 for v in &mut __struct.vel {
12375 let val = buf.get_f32_le();
12376 *v = val;
12377 }
12378 for v in &mut __struct.acc {
12379 let val = buf.get_f32_le();
12380 *v = val;
12381 }
12382 for v in &mut __struct.attitude_q {
12383 let val = buf.get_f32_le();
12384 *v = val;
12385 }
12386 for v in &mut __struct.rates {
12387 let val = buf.get_f32_le();
12388 *v = val;
12389 }
12390 for v in &mut __struct.position_cov {
12391 let val = buf.get_f32_le();
12392 *v = val;
12393 }
12394 __struct.est_capabilities = buf.get_u8();
12395 Ok(__struct)
12396 }
12397 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12398 let mut __tmp = BytesMut::new(bytes);
12399 #[allow(clippy::absurd_extreme_comparisons)]
12400 #[allow(unused_comparisons)]
12401 if __tmp.remaining() < Self::ENCODED_LEN {
12402 panic!(
12403 "buffer is too small (need {} bytes, but got {})",
12404 Self::ENCODED_LEN,
12405 __tmp.remaining(),
12406 )
12407 }
12408 __tmp.put_u64_le(self.timestamp);
12409 __tmp.put_u64_le(self.custom_state);
12410 __tmp.put_i32_le(self.lat);
12411 __tmp.put_i32_le(self.lon);
12412 __tmp.put_f32_le(self.alt);
12413 for val in &self.vel {
12414 __tmp.put_f32_le(*val);
12415 }
12416 for val in &self.acc {
12417 __tmp.put_f32_le(*val);
12418 }
12419 for val in &self.attitude_q {
12420 __tmp.put_f32_le(*val);
12421 }
12422 for val in &self.rates {
12423 __tmp.put_f32_le(*val);
12424 }
12425 for val in &self.position_cov {
12426 __tmp.put_f32_le(*val);
12427 }
12428 __tmp.put_u8(self.est_capabilities);
12429 if matches!(version, MavlinkVersion::V2) {
12430 let len = __tmp.len();
12431 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12432 } else {
12433 __tmp.len()
12434 }
12435 }
12436}
12437#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12438#[doc = ""]
12439#[doc = "ID: 371"]
12440#[derive(Debug, Clone, PartialEq)]
12441#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12442#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12443pub struct FUEL_STATUS_DATA {
12444 #[doc = "Capacity when full. Must be provided."]
12445 pub maximum_fuel: f32,
12446 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12447 pub consumed_fuel: f32,
12448 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12449 pub remaining_fuel: f32,
12450 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12451 pub flow_rate: f32,
12452 #[doc = "Fuel temperature. NaN: field not provided."]
12453 pub temperature: f32,
12454 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12455 pub fuel_type: MavFuelType,
12456 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12457 pub id: u8,
12458 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12459 pub percent_remaining: u8,
12460}
12461impl FUEL_STATUS_DATA {
12462 pub const ENCODED_LEN: usize = 26usize;
12463 pub const DEFAULT: Self = Self {
12464 maximum_fuel: 0.0_f32,
12465 consumed_fuel: 0.0_f32,
12466 remaining_fuel: 0.0_f32,
12467 flow_rate: 0.0_f32,
12468 temperature: 0.0_f32,
12469 fuel_type: MavFuelType::DEFAULT,
12470 id: 0_u8,
12471 percent_remaining: 0_u8,
12472 };
12473 #[cfg(feature = "arbitrary")]
12474 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12475 use arbitrary::{Arbitrary, Unstructured};
12476 let mut buf = [0u8; 1024];
12477 rng.fill_bytes(&mut buf);
12478 let mut unstructured = Unstructured::new(&buf);
12479 Self::arbitrary(&mut unstructured).unwrap_or_default()
12480 }
12481}
12482impl Default for FUEL_STATUS_DATA {
12483 fn default() -> Self {
12484 Self::DEFAULT.clone()
12485 }
12486}
12487impl MessageData for FUEL_STATUS_DATA {
12488 type Message = MavMessage;
12489 const ID: u32 = 371u32;
12490 const NAME: &'static str = "FUEL_STATUS";
12491 const EXTRA_CRC: u8 = 10u8;
12492 const ENCODED_LEN: usize = 26usize;
12493 fn deser(
12494 _version: MavlinkVersion,
12495 __input: &[u8],
12496 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12497 let avail_len = __input.len();
12498 let mut payload_buf = [0; Self::ENCODED_LEN];
12499 let mut buf = if avail_len < Self::ENCODED_LEN {
12500 payload_buf[0..avail_len].copy_from_slice(__input);
12501 Bytes::new(&payload_buf)
12502 } else {
12503 Bytes::new(__input)
12504 };
12505 let mut __struct = Self::default();
12506 __struct.maximum_fuel = buf.get_f32_le();
12507 __struct.consumed_fuel = buf.get_f32_le();
12508 __struct.remaining_fuel = buf.get_f32_le();
12509 __struct.flow_rate = buf.get_f32_le();
12510 __struct.temperature = buf.get_f32_le();
12511 let tmp = buf.get_u32_le();
12512 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12513 ::mavlink_core::error::ParserError::InvalidEnum {
12514 enum_type: "MavFuelType",
12515 value: tmp as u32,
12516 },
12517 )?;
12518 __struct.id = buf.get_u8();
12519 __struct.percent_remaining = buf.get_u8();
12520 Ok(__struct)
12521 }
12522 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12523 let mut __tmp = BytesMut::new(bytes);
12524 #[allow(clippy::absurd_extreme_comparisons)]
12525 #[allow(unused_comparisons)]
12526 if __tmp.remaining() < Self::ENCODED_LEN {
12527 panic!(
12528 "buffer is too small (need {} bytes, but got {})",
12529 Self::ENCODED_LEN,
12530 __tmp.remaining(),
12531 )
12532 }
12533 __tmp.put_f32_le(self.maximum_fuel);
12534 __tmp.put_f32_le(self.consumed_fuel);
12535 __tmp.put_f32_le(self.remaining_fuel);
12536 __tmp.put_f32_le(self.flow_rate);
12537 __tmp.put_f32_le(self.temperature);
12538 __tmp.put_u32_le(self.fuel_type as u32);
12539 __tmp.put_u8(self.id);
12540 __tmp.put_u8(self.percent_remaining);
12541 if matches!(version, MavlinkVersion::V2) {
12542 let len = __tmp.len();
12543 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12544 } else {
12545 __tmp.len()
12546 }
12547 }
12548}
12549#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12550#[doc = ""]
12551#[doc = "ID: 373"]
12552#[derive(Debug, Clone, PartialEq)]
12553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12554#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12555pub struct GENERATOR_STATUS_DATA {
12556 #[doc = "Status flags."]
12557 pub status: MavGeneratorStatusFlag,
12558 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12559 pub battery_current: f32,
12560 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12561 pub load_current: f32,
12562 #[doc = "The power being generated. NaN: field not provided"]
12563 pub power_generated: f32,
12564 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12565 pub bus_voltage: f32,
12566 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12567 pub bat_current_setpoint: f32,
12568 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12569 pub runtime: u32,
12570 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12571 pub time_until_maintenance: i32,
12572 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12573 pub generator_speed: u16,
12574 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12575 pub rectifier_temperature: i16,
12576 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12577 pub generator_temperature: i16,
12578}
12579impl GENERATOR_STATUS_DATA {
12580 pub const ENCODED_LEN: usize = 42usize;
12581 pub const DEFAULT: Self = Self {
12582 status: MavGeneratorStatusFlag::DEFAULT,
12583 battery_current: 0.0_f32,
12584 load_current: 0.0_f32,
12585 power_generated: 0.0_f32,
12586 bus_voltage: 0.0_f32,
12587 bat_current_setpoint: 0.0_f32,
12588 runtime: 0_u32,
12589 time_until_maintenance: 0_i32,
12590 generator_speed: 0_u16,
12591 rectifier_temperature: 0_i16,
12592 generator_temperature: 0_i16,
12593 };
12594 #[cfg(feature = "arbitrary")]
12595 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12596 use arbitrary::{Arbitrary, Unstructured};
12597 let mut buf = [0u8; 1024];
12598 rng.fill_bytes(&mut buf);
12599 let mut unstructured = Unstructured::new(&buf);
12600 Self::arbitrary(&mut unstructured).unwrap_or_default()
12601 }
12602}
12603impl Default for GENERATOR_STATUS_DATA {
12604 fn default() -> Self {
12605 Self::DEFAULT.clone()
12606 }
12607}
12608impl MessageData for GENERATOR_STATUS_DATA {
12609 type Message = MavMessage;
12610 const ID: u32 = 373u32;
12611 const NAME: &'static str = "GENERATOR_STATUS";
12612 const EXTRA_CRC: u8 = 117u8;
12613 const ENCODED_LEN: usize = 42usize;
12614 fn deser(
12615 _version: MavlinkVersion,
12616 __input: &[u8],
12617 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12618 let avail_len = __input.len();
12619 let mut payload_buf = [0; Self::ENCODED_LEN];
12620 let mut buf = if avail_len < Self::ENCODED_LEN {
12621 payload_buf[0..avail_len].copy_from_slice(__input);
12622 Bytes::new(&payload_buf)
12623 } else {
12624 Bytes::new(__input)
12625 };
12626 let mut __struct = Self::default();
12627 let tmp = buf.get_u64_le();
12628 __struct.status = MavGeneratorStatusFlag::from_bits(
12629 tmp & MavGeneratorStatusFlag::all().bits(),
12630 )
12631 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12632 flag_type: "MavGeneratorStatusFlag",
12633 value: tmp as u32,
12634 })?;
12635 __struct.battery_current = buf.get_f32_le();
12636 __struct.load_current = buf.get_f32_le();
12637 __struct.power_generated = buf.get_f32_le();
12638 __struct.bus_voltage = buf.get_f32_le();
12639 __struct.bat_current_setpoint = buf.get_f32_le();
12640 __struct.runtime = buf.get_u32_le();
12641 __struct.time_until_maintenance = buf.get_i32_le();
12642 __struct.generator_speed = buf.get_u16_le();
12643 __struct.rectifier_temperature = buf.get_i16_le();
12644 __struct.generator_temperature = buf.get_i16_le();
12645 Ok(__struct)
12646 }
12647 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12648 let mut __tmp = BytesMut::new(bytes);
12649 #[allow(clippy::absurd_extreme_comparisons)]
12650 #[allow(unused_comparisons)]
12651 if __tmp.remaining() < Self::ENCODED_LEN {
12652 panic!(
12653 "buffer is too small (need {} bytes, but got {})",
12654 Self::ENCODED_LEN,
12655 __tmp.remaining(),
12656 )
12657 }
12658 __tmp.put_u64_le(self.status.bits());
12659 __tmp.put_f32_le(self.battery_current);
12660 __tmp.put_f32_le(self.load_current);
12661 __tmp.put_f32_le(self.power_generated);
12662 __tmp.put_f32_le(self.bus_voltage);
12663 __tmp.put_f32_le(self.bat_current_setpoint);
12664 __tmp.put_u32_le(self.runtime);
12665 __tmp.put_i32_le(self.time_until_maintenance);
12666 __tmp.put_u16_le(self.generator_speed);
12667 __tmp.put_i16_le(self.rectifier_temperature);
12668 __tmp.put_i16_le(self.generator_temperature);
12669 if matches!(version, MavlinkVersion::V2) {
12670 let len = __tmp.len();
12671 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12672 } else {
12673 __tmp.len()
12674 }
12675 }
12676}
12677#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12678#[doc = ""]
12679#[doc = "ID: 285"]
12680#[derive(Debug, Clone, PartialEq)]
12681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12683pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12684 #[doc = "Timestamp (time since system boot)."]
12685 pub time_boot_ms: u32,
12686 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12687 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12688 pub q: [f32; 4],
12689 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12690 pub angular_velocity_x: f32,
12691 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12692 pub angular_velocity_y: f32,
12693 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12694 pub angular_velocity_z: f32,
12695 #[doc = "Failure flags (0 for no failure)"]
12696 pub failure_flags: GimbalDeviceErrorFlags,
12697 #[doc = "Current gimbal flags set."]
12698 pub flags: GimbalDeviceFlags,
12699 #[doc = "System ID"]
12700 pub target_system: u8,
12701 #[doc = "Component ID"]
12702 pub target_component: u8,
12703 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12704 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12705 pub delta_yaw: f32,
12706 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12707 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12708 pub delta_yaw_velocity: f32,
12709 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12710 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12711 pub gimbal_device_id: u8,
12712}
12713impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12714 pub const ENCODED_LEN: usize = 49usize;
12715 pub const DEFAULT: Self = Self {
12716 time_boot_ms: 0_u32,
12717 q: [0.0_f32; 4usize],
12718 angular_velocity_x: 0.0_f32,
12719 angular_velocity_y: 0.0_f32,
12720 angular_velocity_z: 0.0_f32,
12721 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12722 flags: GimbalDeviceFlags::DEFAULT,
12723 target_system: 0_u8,
12724 target_component: 0_u8,
12725 delta_yaw: 0.0_f32,
12726 delta_yaw_velocity: 0.0_f32,
12727 gimbal_device_id: 0_u8,
12728 };
12729 #[cfg(feature = "arbitrary")]
12730 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12731 use arbitrary::{Arbitrary, Unstructured};
12732 let mut buf = [0u8; 1024];
12733 rng.fill_bytes(&mut buf);
12734 let mut unstructured = Unstructured::new(&buf);
12735 Self::arbitrary(&mut unstructured).unwrap_or_default()
12736 }
12737}
12738impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12739 fn default() -> Self {
12740 Self::DEFAULT.clone()
12741 }
12742}
12743impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12744 type Message = MavMessage;
12745 const ID: u32 = 285u32;
12746 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12747 const EXTRA_CRC: u8 = 137u8;
12748 const ENCODED_LEN: usize = 49usize;
12749 fn deser(
12750 _version: MavlinkVersion,
12751 __input: &[u8],
12752 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12753 let avail_len = __input.len();
12754 let mut payload_buf = [0; Self::ENCODED_LEN];
12755 let mut buf = if avail_len < Self::ENCODED_LEN {
12756 payload_buf[0..avail_len].copy_from_slice(__input);
12757 Bytes::new(&payload_buf)
12758 } else {
12759 Bytes::new(__input)
12760 };
12761 let mut __struct = Self::default();
12762 __struct.time_boot_ms = buf.get_u32_le();
12763 for v in &mut __struct.q {
12764 let val = buf.get_f32_le();
12765 *v = val;
12766 }
12767 __struct.angular_velocity_x = buf.get_f32_le();
12768 __struct.angular_velocity_y = buf.get_f32_le();
12769 __struct.angular_velocity_z = buf.get_f32_le();
12770 let tmp = buf.get_u32_le();
12771 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12772 tmp & GimbalDeviceErrorFlags::all().bits(),
12773 )
12774 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12775 flag_type: "GimbalDeviceErrorFlags",
12776 value: tmp as u32,
12777 })?;
12778 let tmp = buf.get_u16_le();
12779 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12780 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12781 flag_type: "GimbalDeviceFlags",
12782 value: tmp as u32,
12783 })?;
12784 __struct.target_system = buf.get_u8();
12785 __struct.target_component = buf.get_u8();
12786 __struct.delta_yaw = buf.get_f32_le();
12787 __struct.delta_yaw_velocity = buf.get_f32_le();
12788 __struct.gimbal_device_id = buf.get_u8();
12789 Ok(__struct)
12790 }
12791 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12792 let mut __tmp = BytesMut::new(bytes);
12793 #[allow(clippy::absurd_extreme_comparisons)]
12794 #[allow(unused_comparisons)]
12795 if __tmp.remaining() < Self::ENCODED_LEN {
12796 panic!(
12797 "buffer is too small (need {} bytes, but got {})",
12798 Self::ENCODED_LEN,
12799 __tmp.remaining(),
12800 )
12801 }
12802 __tmp.put_u32_le(self.time_boot_ms);
12803 for val in &self.q {
12804 __tmp.put_f32_le(*val);
12805 }
12806 __tmp.put_f32_le(self.angular_velocity_x);
12807 __tmp.put_f32_le(self.angular_velocity_y);
12808 __tmp.put_f32_le(self.angular_velocity_z);
12809 __tmp.put_u32_le(self.failure_flags.bits());
12810 __tmp.put_u16_le(self.flags.bits());
12811 __tmp.put_u8(self.target_system);
12812 __tmp.put_u8(self.target_component);
12813 if matches!(version, MavlinkVersion::V2) {
12814 __tmp.put_f32_le(self.delta_yaw);
12815 __tmp.put_f32_le(self.delta_yaw_velocity);
12816 __tmp.put_u8(self.gimbal_device_id);
12817 let len = __tmp.len();
12818 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12819 } else {
12820 __tmp.len()
12821 }
12822 }
12823}
12824#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12825#[doc = ""]
12826#[doc = "ID: 283"]
12827#[derive(Debug, Clone, PartialEq)]
12828#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12829#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12830pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12831 #[doc = "UID of gimbal hardware (0 if unknown)."]
12832 pub uid: u64,
12833 #[doc = "Timestamp (time since system boot)."]
12834 pub time_boot_ms: u32,
12835 #[doc = "0xff)."]
12836 pub firmware_version: u32,
12837 #[doc = "0xff)."]
12838 pub hardware_version: u32,
12839 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12840 pub roll_min: f32,
12841 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12842 pub roll_max: f32,
12843 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12844 pub pitch_min: f32,
12845 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12846 pub pitch_max: f32,
12847 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12848 pub yaw_min: f32,
12849 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12850 pub yaw_max: f32,
12851 #[doc = "Bitmap of gimbal capability flags."]
12852 pub cap_flags: GimbalDeviceCapFlags,
12853 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12854 pub custom_cap_flags: u16,
12855 #[doc = "Name of the gimbal vendor."]
12856 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12857 pub vendor_name: [u8; 32],
12858 #[doc = "Name of the gimbal model."]
12859 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12860 pub model_name: [u8; 32],
12861 #[doc = "Custom name of the gimbal given to it by the user."]
12862 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12863 pub custom_name: [u8; 32],
12864 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12865 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12866 pub gimbal_device_id: u8,
12867}
12868impl GIMBAL_DEVICE_INFORMATION_DATA {
12869 pub const ENCODED_LEN: usize = 145usize;
12870 pub const DEFAULT: Self = Self {
12871 uid: 0_u64,
12872 time_boot_ms: 0_u32,
12873 firmware_version: 0_u32,
12874 hardware_version: 0_u32,
12875 roll_min: 0.0_f32,
12876 roll_max: 0.0_f32,
12877 pitch_min: 0.0_f32,
12878 pitch_max: 0.0_f32,
12879 yaw_min: 0.0_f32,
12880 yaw_max: 0.0_f32,
12881 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12882 custom_cap_flags: 0_u16,
12883 vendor_name: [0_u8; 32usize],
12884 model_name: [0_u8; 32usize],
12885 custom_name: [0_u8; 32usize],
12886 gimbal_device_id: 0_u8,
12887 };
12888 #[cfg(feature = "arbitrary")]
12889 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12890 use arbitrary::{Arbitrary, Unstructured};
12891 let mut buf = [0u8; 1024];
12892 rng.fill_bytes(&mut buf);
12893 let mut unstructured = Unstructured::new(&buf);
12894 Self::arbitrary(&mut unstructured).unwrap_or_default()
12895 }
12896}
12897impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12898 fn default() -> Self {
12899 Self::DEFAULT.clone()
12900 }
12901}
12902impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12903 type Message = MavMessage;
12904 const ID: u32 = 283u32;
12905 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12906 const EXTRA_CRC: u8 = 74u8;
12907 const ENCODED_LEN: usize = 145usize;
12908 fn deser(
12909 _version: MavlinkVersion,
12910 __input: &[u8],
12911 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12912 let avail_len = __input.len();
12913 let mut payload_buf = [0; Self::ENCODED_LEN];
12914 let mut buf = if avail_len < Self::ENCODED_LEN {
12915 payload_buf[0..avail_len].copy_from_slice(__input);
12916 Bytes::new(&payload_buf)
12917 } else {
12918 Bytes::new(__input)
12919 };
12920 let mut __struct = Self::default();
12921 __struct.uid = buf.get_u64_le();
12922 __struct.time_boot_ms = buf.get_u32_le();
12923 __struct.firmware_version = buf.get_u32_le();
12924 __struct.hardware_version = buf.get_u32_le();
12925 __struct.roll_min = buf.get_f32_le();
12926 __struct.roll_max = buf.get_f32_le();
12927 __struct.pitch_min = buf.get_f32_le();
12928 __struct.pitch_max = buf.get_f32_le();
12929 __struct.yaw_min = buf.get_f32_le();
12930 __struct.yaw_max = buf.get_f32_le();
12931 let tmp = buf.get_u16_le();
12932 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12933 tmp & GimbalDeviceCapFlags::all().bits(),
12934 )
12935 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12936 flag_type: "GimbalDeviceCapFlags",
12937 value: tmp as u32,
12938 })?;
12939 __struct.custom_cap_flags = buf.get_u16_le();
12940 for v in &mut __struct.vendor_name {
12941 let val = buf.get_u8();
12942 *v = val;
12943 }
12944 for v in &mut __struct.model_name {
12945 let val = buf.get_u8();
12946 *v = val;
12947 }
12948 for v in &mut __struct.custom_name {
12949 let val = buf.get_u8();
12950 *v = val;
12951 }
12952 __struct.gimbal_device_id = buf.get_u8();
12953 Ok(__struct)
12954 }
12955 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12956 let mut __tmp = BytesMut::new(bytes);
12957 #[allow(clippy::absurd_extreme_comparisons)]
12958 #[allow(unused_comparisons)]
12959 if __tmp.remaining() < Self::ENCODED_LEN {
12960 panic!(
12961 "buffer is too small (need {} bytes, but got {})",
12962 Self::ENCODED_LEN,
12963 __tmp.remaining(),
12964 )
12965 }
12966 __tmp.put_u64_le(self.uid);
12967 __tmp.put_u32_le(self.time_boot_ms);
12968 __tmp.put_u32_le(self.firmware_version);
12969 __tmp.put_u32_le(self.hardware_version);
12970 __tmp.put_f32_le(self.roll_min);
12971 __tmp.put_f32_le(self.roll_max);
12972 __tmp.put_f32_le(self.pitch_min);
12973 __tmp.put_f32_le(self.pitch_max);
12974 __tmp.put_f32_le(self.yaw_min);
12975 __tmp.put_f32_le(self.yaw_max);
12976 __tmp.put_u16_le(self.cap_flags.bits());
12977 __tmp.put_u16_le(self.custom_cap_flags);
12978 for val in &self.vendor_name {
12979 __tmp.put_u8(*val);
12980 }
12981 for val in &self.model_name {
12982 __tmp.put_u8(*val);
12983 }
12984 for val in &self.custom_name {
12985 __tmp.put_u8(*val);
12986 }
12987 if matches!(version, MavlinkVersion::V2) {
12988 __tmp.put_u8(self.gimbal_device_id);
12989 let len = __tmp.len();
12990 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12991 } else {
12992 __tmp.len()
12993 }
12994 }
12995}
12996#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12997#[doc = ""]
12998#[doc = "ID: 284"]
12999#[derive(Debug, Clone, PartialEq)]
13000#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13001#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13002pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13003 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
13004 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13005 pub q: [f32; 4],
13006 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
13007 pub angular_velocity_x: f32,
13008 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
13009 pub angular_velocity_y: f32,
13010 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
13011 pub angular_velocity_z: f32,
13012 #[doc = "Low level gimbal flags."]
13013 pub flags: GimbalDeviceFlags,
13014 #[doc = "System ID"]
13015 pub target_system: u8,
13016 #[doc = "Component ID"]
13017 pub target_component: u8,
13018}
13019impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13020 pub const ENCODED_LEN: usize = 32usize;
13021 pub const DEFAULT: Self = Self {
13022 q: [0.0_f32; 4usize],
13023 angular_velocity_x: 0.0_f32,
13024 angular_velocity_y: 0.0_f32,
13025 angular_velocity_z: 0.0_f32,
13026 flags: GimbalDeviceFlags::DEFAULT,
13027 target_system: 0_u8,
13028 target_component: 0_u8,
13029 };
13030 #[cfg(feature = "arbitrary")]
13031 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13032 use arbitrary::{Arbitrary, Unstructured};
13033 let mut buf = [0u8; 1024];
13034 rng.fill_bytes(&mut buf);
13035 let mut unstructured = Unstructured::new(&buf);
13036 Self::arbitrary(&mut unstructured).unwrap_or_default()
13037 }
13038}
13039impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13040 fn default() -> Self {
13041 Self::DEFAULT.clone()
13042 }
13043}
13044impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13045 type Message = MavMessage;
13046 const ID: u32 = 284u32;
13047 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
13048 const EXTRA_CRC: u8 = 99u8;
13049 const ENCODED_LEN: usize = 32usize;
13050 fn deser(
13051 _version: MavlinkVersion,
13052 __input: &[u8],
13053 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13054 let avail_len = __input.len();
13055 let mut payload_buf = [0; Self::ENCODED_LEN];
13056 let mut buf = if avail_len < Self::ENCODED_LEN {
13057 payload_buf[0..avail_len].copy_from_slice(__input);
13058 Bytes::new(&payload_buf)
13059 } else {
13060 Bytes::new(__input)
13061 };
13062 let mut __struct = Self::default();
13063 for v in &mut __struct.q {
13064 let val = buf.get_f32_le();
13065 *v = val;
13066 }
13067 __struct.angular_velocity_x = buf.get_f32_le();
13068 __struct.angular_velocity_y = buf.get_f32_le();
13069 __struct.angular_velocity_z = buf.get_f32_le();
13070 let tmp = buf.get_u16_le();
13071 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
13072 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13073 flag_type: "GimbalDeviceFlags",
13074 value: tmp as u32,
13075 })?;
13076 __struct.target_system = buf.get_u8();
13077 __struct.target_component = buf.get_u8();
13078 Ok(__struct)
13079 }
13080 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13081 let mut __tmp = BytesMut::new(bytes);
13082 #[allow(clippy::absurd_extreme_comparisons)]
13083 #[allow(unused_comparisons)]
13084 if __tmp.remaining() < Self::ENCODED_LEN {
13085 panic!(
13086 "buffer is too small (need {} bytes, but got {})",
13087 Self::ENCODED_LEN,
13088 __tmp.remaining(),
13089 )
13090 }
13091 for val in &self.q {
13092 __tmp.put_f32_le(*val);
13093 }
13094 __tmp.put_f32_le(self.angular_velocity_x);
13095 __tmp.put_f32_le(self.angular_velocity_y);
13096 __tmp.put_f32_le(self.angular_velocity_z);
13097 __tmp.put_u16_le(self.flags.bits());
13098 __tmp.put_u8(self.target_system);
13099 __tmp.put_u8(self.target_component);
13100 if matches!(version, MavlinkVersion::V2) {
13101 let len = __tmp.len();
13102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13103 } else {
13104 __tmp.len()
13105 }
13106 }
13107}
13108#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
13109#[doc = ""]
13110#[doc = "ID: 280"]
13111#[derive(Debug, Clone, PartialEq)]
13112#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13114pub struct GIMBAL_MANAGER_INFORMATION_DATA {
13115 #[doc = "Timestamp (time since system boot)."]
13116 pub time_boot_ms: u32,
13117 #[doc = "Bitmap of gimbal capability flags."]
13118 pub cap_flags: GimbalManagerCapFlags,
13119 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13120 pub roll_min: f32,
13121 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13122 pub roll_max: f32,
13123 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
13124 pub pitch_min: f32,
13125 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
13126 pub pitch_max: f32,
13127 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
13128 pub yaw_min: f32,
13129 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
13130 pub yaw_max: f32,
13131 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13132 pub gimbal_device_id: u8,
13133}
13134impl GIMBAL_MANAGER_INFORMATION_DATA {
13135 pub const ENCODED_LEN: usize = 33usize;
13136 pub const DEFAULT: Self = Self {
13137 time_boot_ms: 0_u32,
13138 cap_flags: GimbalManagerCapFlags::DEFAULT,
13139 roll_min: 0.0_f32,
13140 roll_max: 0.0_f32,
13141 pitch_min: 0.0_f32,
13142 pitch_max: 0.0_f32,
13143 yaw_min: 0.0_f32,
13144 yaw_max: 0.0_f32,
13145 gimbal_device_id: 0_u8,
13146 };
13147 #[cfg(feature = "arbitrary")]
13148 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13149 use arbitrary::{Arbitrary, Unstructured};
13150 let mut buf = [0u8; 1024];
13151 rng.fill_bytes(&mut buf);
13152 let mut unstructured = Unstructured::new(&buf);
13153 Self::arbitrary(&mut unstructured).unwrap_or_default()
13154 }
13155}
13156impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
13157 fn default() -> Self {
13158 Self::DEFAULT.clone()
13159 }
13160}
13161impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
13162 type Message = MavMessage;
13163 const ID: u32 = 280u32;
13164 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
13165 const EXTRA_CRC: u8 = 70u8;
13166 const ENCODED_LEN: usize = 33usize;
13167 fn deser(
13168 _version: MavlinkVersion,
13169 __input: &[u8],
13170 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13171 let avail_len = __input.len();
13172 let mut payload_buf = [0; Self::ENCODED_LEN];
13173 let mut buf = if avail_len < Self::ENCODED_LEN {
13174 payload_buf[0..avail_len].copy_from_slice(__input);
13175 Bytes::new(&payload_buf)
13176 } else {
13177 Bytes::new(__input)
13178 };
13179 let mut __struct = Self::default();
13180 __struct.time_boot_ms = buf.get_u32_le();
13181 let tmp = buf.get_u32_le();
13182 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
13183 tmp & GimbalManagerCapFlags::all().bits(),
13184 )
13185 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13186 flag_type: "GimbalManagerCapFlags",
13187 value: tmp as u32,
13188 })?;
13189 __struct.roll_min = buf.get_f32_le();
13190 __struct.roll_max = buf.get_f32_le();
13191 __struct.pitch_min = buf.get_f32_le();
13192 __struct.pitch_max = buf.get_f32_le();
13193 __struct.yaw_min = buf.get_f32_le();
13194 __struct.yaw_max = buf.get_f32_le();
13195 __struct.gimbal_device_id = buf.get_u8();
13196 Ok(__struct)
13197 }
13198 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13199 let mut __tmp = BytesMut::new(bytes);
13200 #[allow(clippy::absurd_extreme_comparisons)]
13201 #[allow(unused_comparisons)]
13202 if __tmp.remaining() < Self::ENCODED_LEN {
13203 panic!(
13204 "buffer is too small (need {} bytes, but got {})",
13205 Self::ENCODED_LEN,
13206 __tmp.remaining(),
13207 )
13208 }
13209 __tmp.put_u32_le(self.time_boot_ms);
13210 __tmp.put_u32_le(self.cap_flags.bits());
13211 __tmp.put_f32_le(self.roll_min);
13212 __tmp.put_f32_le(self.roll_max);
13213 __tmp.put_f32_le(self.pitch_min);
13214 __tmp.put_f32_le(self.pitch_max);
13215 __tmp.put_f32_le(self.yaw_min);
13216 __tmp.put_f32_le(self.yaw_max);
13217 __tmp.put_u8(self.gimbal_device_id);
13218 if matches!(version, MavlinkVersion::V2) {
13219 let len = __tmp.len();
13220 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13221 } else {
13222 __tmp.len()
13223 }
13224 }
13225}
13226#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13227#[doc = ""]
13228#[doc = "ID: 282"]
13229#[derive(Debug, Clone, PartialEq)]
13230#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13231#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13232pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13233 #[doc = "High level gimbal manager flags to use."]
13234 pub flags: GimbalManagerFlags,
13235 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13236 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13237 pub q: [f32; 4],
13238 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13239 pub angular_velocity_x: f32,
13240 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13241 pub angular_velocity_y: f32,
13242 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13243 pub angular_velocity_z: f32,
13244 #[doc = "System ID"]
13245 pub target_system: u8,
13246 #[doc = "Component ID"]
13247 pub target_component: u8,
13248 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13249 pub gimbal_device_id: u8,
13250}
13251impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13252 pub const ENCODED_LEN: usize = 35usize;
13253 pub const DEFAULT: Self = Self {
13254 flags: GimbalManagerFlags::DEFAULT,
13255 q: [0.0_f32; 4usize],
13256 angular_velocity_x: 0.0_f32,
13257 angular_velocity_y: 0.0_f32,
13258 angular_velocity_z: 0.0_f32,
13259 target_system: 0_u8,
13260 target_component: 0_u8,
13261 gimbal_device_id: 0_u8,
13262 };
13263 #[cfg(feature = "arbitrary")]
13264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13265 use arbitrary::{Arbitrary, Unstructured};
13266 let mut buf = [0u8; 1024];
13267 rng.fill_bytes(&mut buf);
13268 let mut unstructured = Unstructured::new(&buf);
13269 Self::arbitrary(&mut unstructured).unwrap_or_default()
13270 }
13271}
13272impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13273 fn default() -> Self {
13274 Self::DEFAULT.clone()
13275 }
13276}
13277impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13278 type Message = MavMessage;
13279 const ID: u32 = 282u32;
13280 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13281 const EXTRA_CRC: u8 = 123u8;
13282 const ENCODED_LEN: usize = 35usize;
13283 fn deser(
13284 _version: MavlinkVersion,
13285 __input: &[u8],
13286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13287 let avail_len = __input.len();
13288 let mut payload_buf = [0; Self::ENCODED_LEN];
13289 let mut buf = if avail_len < Self::ENCODED_LEN {
13290 payload_buf[0..avail_len].copy_from_slice(__input);
13291 Bytes::new(&payload_buf)
13292 } else {
13293 Bytes::new(__input)
13294 };
13295 let mut __struct = Self::default();
13296 let tmp = buf.get_u32_le();
13297 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13298 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13299 flag_type: "GimbalManagerFlags",
13300 value: tmp as u32,
13301 })?;
13302 for v in &mut __struct.q {
13303 let val = buf.get_f32_le();
13304 *v = val;
13305 }
13306 __struct.angular_velocity_x = buf.get_f32_le();
13307 __struct.angular_velocity_y = buf.get_f32_le();
13308 __struct.angular_velocity_z = buf.get_f32_le();
13309 __struct.target_system = buf.get_u8();
13310 __struct.target_component = buf.get_u8();
13311 __struct.gimbal_device_id = buf.get_u8();
13312 Ok(__struct)
13313 }
13314 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13315 let mut __tmp = BytesMut::new(bytes);
13316 #[allow(clippy::absurd_extreme_comparisons)]
13317 #[allow(unused_comparisons)]
13318 if __tmp.remaining() < Self::ENCODED_LEN {
13319 panic!(
13320 "buffer is too small (need {} bytes, but got {})",
13321 Self::ENCODED_LEN,
13322 __tmp.remaining(),
13323 )
13324 }
13325 __tmp.put_u32_le(self.flags.bits());
13326 for val in &self.q {
13327 __tmp.put_f32_le(*val);
13328 }
13329 __tmp.put_f32_le(self.angular_velocity_x);
13330 __tmp.put_f32_le(self.angular_velocity_y);
13331 __tmp.put_f32_le(self.angular_velocity_z);
13332 __tmp.put_u8(self.target_system);
13333 __tmp.put_u8(self.target_component);
13334 __tmp.put_u8(self.gimbal_device_id);
13335 if matches!(version, MavlinkVersion::V2) {
13336 let len = __tmp.len();
13337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13338 } else {
13339 __tmp.len()
13340 }
13341 }
13342}
13343#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13344#[doc = ""]
13345#[doc = "ID: 288"]
13346#[derive(Debug, Clone, PartialEq)]
13347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13349pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13350 #[doc = "High level gimbal manager flags."]
13351 pub flags: GimbalManagerFlags,
13352 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13353 pub pitch: f32,
13354 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13355 pub yaw: f32,
13356 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13357 pub pitch_rate: f32,
13358 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13359 pub yaw_rate: f32,
13360 #[doc = "System ID"]
13361 pub target_system: u8,
13362 #[doc = "Component ID"]
13363 pub target_component: u8,
13364 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13365 pub gimbal_device_id: u8,
13366}
13367impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13368 pub const ENCODED_LEN: usize = 23usize;
13369 pub const DEFAULT: Self = Self {
13370 flags: GimbalManagerFlags::DEFAULT,
13371 pitch: 0.0_f32,
13372 yaw: 0.0_f32,
13373 pitch_rate: 0.0_f32,
13374 yaw_rate: 0.0_f32,
13375 target_system: 0_u8,
13376 target_component: 0_u8,
13377 gimbal_device_id: 0_u8,
13378 };
13379 #[cfg(feature = "arbitrary")]
13380 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13381 use arbitrary::{Arbitrary, Unstructured};
13382 let mut buf = [0u8; 1024];
13383 rng.fill_bytes(&mut buf);
13384 let mut unstructured = Unstructured::new(&buf);
13385 Self::arbitrary(&mut unstructured).unwrap_or_default()
13386 }
13387}
13388impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13389 fn default() -> Self {
13390 Self::DEFAULT.clone()
13391 }
13392}
13393impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13394 type Message = MavMessage;
13395 const ID: u32 = 288u32;
13396 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13397 const EXTRA_CRC: u8 = 20u8;
13398 const ENCODED_LEN: usize = 23usize;
13399 fn deser(
13400 _version: MavlinkVersion,
13401 __input: &[u8],
13402 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13403 let avail_len = __input.len();
13404 let mut payload_buf = [0; Self::ENCODED_LEN];
13405 let mut buf = if avail_len < Self::ENCODED_LEN {
13406 payload_buf[0..avail_len].copy_from_slice(__input);
13407 Bytes::new(&payload_buf)
13408 } else {
13409 Bytes::new(__input)
13410 };
13411 let mut __struct = Self::default();
13412 let tmp = buf.get_u32_le();
13413 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13414 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13415 flag_type: "GimbalManagerFlags",
13416 value: tmp as u32,
13417 })?;
13418 __struct.pitch = buf.get_f32_le();
13419 __struct.yaw = buf.get_f32_le();
13420 __struct.pitch_rate = buf.get_f32_le();
13421 __struct.yaw_rate = buf.get_f32_le();
13422 __struct.target_system = buf.get_u8();
13423 __struct.target_component = buf.get_u8();
13424 __struct.gimbal_device_id = buf.get_u8();
13425 Ok(__struct)
13426 }
13427 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13428 let mut __tmp = BytesMut::new(bytes);
13429 #[allow(clippy::absurd_extreme_comparisons)]
13430 #[allow(unused_comparisons)]
13431 if __tmp.remaining() < Self::ENCODED_LEN {
13432 panic!(
13433 "buffer is too small (need {} bytes, but got {})",
13434 Self::ENCODED_LEN,
13435 __tmp.remaining(),
13436 )
13437 }
13438 __tmp.put_u32_le(self.flags.bits());
13439 __tmp.put_f32_le(self.pitch);
13440 __tmp.put_f32_le(self.yaw);
13441 __tmp.put_f32_le(self.pitch_rate);
13442 __tmp.put_f32_le(self.yaw_rate);
13443 __tmp.put_u8(self.target_system);
13444 __tmp.put_u8(self.target_component);
13445 __tmp.put_u8(self.gimbal_device_id);
13446 if matches!(version, MavlinkVersion::V2) {
13447 let len = __tmp.len();
13448 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13449 } else {
13450 __tmp.len()
13451 }
13452 }
13453}
13454#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13455#[doc = ""]
13456#[doc = "ID: 287"]
13457#[derive(Debug, Clone, PartialEq)]
13458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13460pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13461 #[doc = "High level gimbal manager flags to use."]
13462 pub flags: GimbalManagerFlags,
13463 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13464 pub pitch: f32,
13465 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13466 pub yaw: f32,
13467 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13468 pub pitch_rate: f32,
13469 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13470 pub yaw_rate: f32,
13471 #[doc = "System ID"]
13472 pub target_system: u8,
13473 #[doc = "Component ID"]
13474 pub target_component: u8,
13475 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13476 pub gimbal_device_id: u8,
13477}
13478impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13479 pub const ENCODED_LEN: usize = 23usize;
13480 pub const DEFAULT: Self = Self {
13481 flags: GimbalManagerFlags::DEFAULT,
13482 pitch: 0.0_f32,
13483 yaw: 0.0_f32,
13484 pitch_rate: 0.0_f32,
13485 yaw_rate: 0.0_f32,
13486 target_system: 0_u8,
13487 target_component: 0_u8,
13488 gimbal_device_id: 0_u8,
13489 };
13490 #[cfg(feature = "arbitrary")]
13491 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13492 use arbitrary::{Arbitrary, Unstructured};
13493 let mut buf = [0u8; 1024];
13494 rng.fill_bytes(&mut buf);
13495 let mut unstructured = Unstructured::new(&buf);
13496 Self::arbitrary(&mut unstructured).unwrap_or_default()
13497 }
13498}
13499impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13500 fn default() -> Self {
13501 Self::DEFAULT.clone()
13502 }
13503}
13504impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13505 type Message = MavMessage;
13506 const ID: u32 = 287u32;
13507 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13508 const EXTRA_CRC: u8 = 1u8;
13509 const ENCODED_LEN: usize = 23usize;
13510 fn deser(
13511 _version: MavlinkVersion,
13512 __input: &[u8],
13513 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13514 let avail_len = __input.len();
13515 let mut payload_buf = [0; Self::ENCODED_LEN];
13516 let mut buf = if avail_len < Self::ENCODED_LEN {
13517 payload_buf[0..avail_len].copy_from_slice(__input);
13518 Bytes::new(&payload_buf)
13519 } else {
13520 Bytes::new(__input)
13521 };
13522 let mut __struct = Self::default();
13523 let tmp = buf.get_u32_le();
13524 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13525 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13526 flag_type: "GimbalManagerFlags",
13527 value: tmp as u32,
13528 })?;
13529 __struct.pitch = buf.get_f32_le();
13530 __struct.yaw = buf.get_f32_le();
13531 __struct.pitch_rate = buf.get_f32_le();
13532 __struct.yaw_rate = buf.get_f32_le();
13533 __struct.target_system = buf.get_u8();
13534 __struct.target_component = buf.get_u8();
13535 __struct.gimbal_device_id = buf.get_u8();
13536 Ok(__struct)
13537 }
13538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13539 let mut __tmp = BytesMut::new(bytes);
13540 #[allow(clippy::absurd_extreme_comparisons)]
13541 #[allow(unused_comparisons)]
13542 if __tmp.remaining() < Self::ENCODED_LEN {
13543 panic!(
13544 "buffer is too small (need {} bytes, but got {})",
13545 Self::ENCODED_LEN,
13546 __tmp.remaining(),
13547 )
13548 }
13549 __tmp.put_u32_le(self.flags.bits());
13550 __tmp.put_f32_le(self.pitch);
13551 __tmp.put_f32_le(self.yaw);
13552 __tmp.put_f32_le(self.pitch_rate);
13553 __tmp.put_f32_le(self.yaw_rate);
13554 __tmp.put_u8(self.target_system);
13555 __tmp.put_u8(self.target_component);
13556 __tmp.put_u8(self.gimbal_device_id);
13557 if matches!(version, MavlinkVersion::V2) {
13558 let len = __tmp.len();
13559 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13560 } else {
13561 __tmp.len()
13562 }
13563 }
13564}
13565#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13566#[doc = ""]
13567#[doc = "ID: 281"]
13568#[derive(Debug, Clone, PartialEq)]
13569#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13570#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13571pub struct GIMBAL_MANAGER_STATUS_DATA {
13572 #[doc = "Timestamp (time since system boot)."]
13573 pub time_boot_ms: u32,
13574 #[doc = "High level gimbal manager flags currently applied."]
13575 pub flags: GimbalManagerFlags,
13576 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13577 pub gimbal_device_id: u8,
13578 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13579 pub primary_control_sysid: u8,
13580 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13581 pub primary_control_compid: u8,
13582 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13583 pub secondary_control_sysid: u8,
13584 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13585 pub secondary_control_compid: u8,
13586}
13587impl GIMBAL_MANAGER_STATUS_DATA {
13588 pub const ENCODED_LEN: usize = 13usize;
13589 pub const DEFAULT: Self = Self {
13590 time_boot_ms: 0_u32,
13591 flags: GimbalManagerFlags::DEFAULT,
13592 gimbal_device_id: 0_u8,
13593 primary_control_sysid: 0_u8,
13594 primary_control_compid: 0_u8,
13595 secondary_control_sysid: 0_u8,
13596 secondary_control_compid: 0_u8,
13597 };
13598 #[cfg(feature = "arbitrary")]
13599 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13600 use arbitrary::{Arbitrary, Unstructured};
13601 let mut buf = [0u8; 1024];
13602 rng.fill_bytes(&mut buf);
13603 let mut unstructured = Unstructured::new(&buf);
13604 Self::arbitrary(&mut unstructured).unwrap_or_default()
13605 }
13606}
13607impl Default for GIMBAL_MANAGER_STATUS_DATA {
13608 fn default() -> Self {
13609 Self::DEFAULT.clone()
13610 }
13611}
13612impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13613 type Message = MavMessage;
13614 const ID: u32 = 281u32;
13615 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13616 const EXTRA_CRC: u8 = 48u8;
13617 const ENCODED_LEN: usize = 13usize;
13618 fn deser(
13619 _version: MavlinkVersion,
13620 __input: &[u8],
13621 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13622 let avail_len = __input.len();
13623 let mut payload_buf = [0; Self::ENCODED_LEN];
13624 let mut buf = if avail_len < Self::ENCODED_LEN {
13625 payload_buf[0..avail_len].copy_from_slice(__input);
13626 Bytes::new(&payload_buf)
13627 } else {
13628 Bytes::new(__input)
13629 };
13630 let mut __struct = Self::default();
13631 __struct.time_boot_ms = buf.get_u32_le();
13632 let tmp = buf.get_u32_le();
13633 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13634 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13635 flag_type: "GimbalManagerFlags",
13636 value: tmp as u32,
13637 })?;
13638 __struct.gimbal_device_id = buf.get_u8();
13639 __struct.primary_control_sysid = buf.get_u8();
13640 __struct.primary_control_compid = buf.get_u8();
13641 __struct.secondary_control_sysid = buf.get_u8();
13642 __struct.secondary_control_compid = buf.get_u8();
13643 Ok(__struct)
13644 }
13645 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13646 let mut __tmp = BytesMut::new(bytes);
13647 #[allow(clippy::absurd_extreme_comparisons)]
13648 #[allow(unused_comparisons)]
13649 if __tmp.remaining() < Self::ENCODED_LEN {
13650 panic!(
13651 "buffer is too small (need {} bytes, but got {})",
13652 Self::ENCODED_LEN,
13653 __tmp.remaining(),
13654 )
13655 }
13656 __tmp.put_u32_le(self.time_boot_ms);
13657 __tmp.put_u32_le(self.flags.bits());
13658 __tmp.put_u8(self.gimbal_device_id);
13659 __tmp.put_u8(self.primary_control_sysid);
13660 __tmp.put_u8(self.primary_control_compid);
13661 __tmp.put_u8(self.secondary_control_sysid);
13662 __tmp.put_u8(self.secondary_control_compid);
13663 if matches!(version, MavlinkVersion::V2) {
13664 let len = __tmp.len();
13665 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13666 } else {
13667 __tmp.len()
13668 }
13669 }
13670}
13671#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13672#[doc = ""]
13673#[doc = "ID: 33"]
13674#[derive(Debug, Clone, PartialEq)]
13675#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13676#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13677pub struct GLOBAL_POSITION_INT_DATA {
13678 #[doc = "Timestamp (time since system boot)."]
13679 pub time_boot_ms: u32,
13680 #[doc = "Latitude, expressed"]
13681 pub lat: i32,
13682 #[doc = "Longitude, expressed"]
13683 pub lon: i32,
13684 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13685 pub alt: i32,
13686 #[doc = "Altitude above home"]
13687 pub relative_alt: i32,
13688 #[doc = "Ground X Speed (Latitude, positive north)"]
13689 pub vx: i16,
13690 #[doc = "Ground Y Speed (Longitude, positive east)"]
13691 pub vy: i16,
13692 #[doc = "Ground Z Speed (Altitude, positive down)"]
13693 pub vz: i16,
13694 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13695 pub hdg: u16,
13696}
13697impl GLOBAL_POSITION_INT_DATA {
13698 pub const ENCODED_LEN: usize = 28usize;
13699 pub const DEFAULT: Self = Self {
13700 time_boot_ms: 0_u32,
13701 lat: 0_i32,
13702 lon: 0_i32,
13703 alt: 0_i32,
13704 relative_alt: 0_i32,
13705 vx: 0_i16,
13706 vy: 0_i16,
13707 vz: 0_i16,
13708 hdg: 0_u16,
13709 };
13710 #[cfg(feature = "arbitrary")]
13711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13712 use arbitrary::{Arbitrary, Unstructured};
13713 let mut buf = [0u8; 1024];
13714 rng.fill_bytes(&mut buf);
13715 let mut unstructured = Unstructured::new(&buf);
13716 Self::arbitrary(&mut unstructured).unwrap_or_default()
13717 }
13718}
13719impl Default for GLOBAL_POSITION_INT_DATA {
13720 fn default() -> Self {
13721 Self::DEFAULT.clone()
13722 }
13723}
13724impl MessageData for GLOBAL_POSITION_INT_DATA {
13725 type Message = MavMessage;
13726 const ID: u32 = 33u32;
13727 const NAME: &'static str = "GLOBAL_POSITION_INT";
13728 const EXTRA_CRC: u8 = 104u8;
13729 const ENCODED_LEN: usize = 28usize;
13730 fn deser(
13731 _version: MavlinkVersion,
13732 __input: &[u8],
13733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13734 let avail_len = __input.len();
13735 let mut payload_buf = [0; Self::ENCODED_LEN];
13736 let mut buf = if avail_len < Self::ENCODED_LEN {
13737 payload_buf[0..avail_len].copy_from_slice(__input);
13738 Bytes::new(&payload_buf)
13739 } else {
13740 Bytes::new(__input)
13741 };
13742 let mut __struct = Self::default();
13743 __struct.time_boot_ms = buf.get_u32_le();
13744 __struct.lat = buf.get_i32_le();
13745 __struct.lon = buf.get_i32_le();
13746 __struct.alt = buf.get_i32_le();
13747 __struct.relative_alt = buf.get_i32_le();
13748 __struct.vx = buf.get_i16_le();
13749 __struct.vy = buf.get_i16_le();
13750 __struct.vz = buf.get_i16_le();
13751 __struct.hdg = buf.get_u16_le();
13752 Ok(__struct)
13753 }
13754 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13755 let mut __tmp = BytesMut::new(bytes);
13756 #[allow(clippy::absurd_extreme_comparisons)]
13757 #[allow(unused_comparisons)]
13758 if __tmp.remaining() < Self::ENCODED_LEN {
13759 panic!(
13760 "buffer is too small (need {} bytes, but got {})",
13761 Self::ENCODED_LEN,
13762 __tmp.remaining(),
13763 )
13764 }
13765 __tmp.put_u32_le(self.time_boot_ms);
13766 __tmp.put_i32_le(self.lat);
13767 __tmp.put_i32_le(self.lon);
13768 __tmp.put_i32_le(self.alt);
13769 __tmp.put_i32_le(self.relative_alt);
13770 __tmp.put_i16_le(self.vx);
13771 __tmp.put_i16_le(self.vy);
13772 __tmp.put_i16_le(self.vz);
13773 __tmp.put_u16_le(self.hdg);
13774 if matches!(version, MavlinkVersion::V2) {
13775 let len = __tmp.len();
13776 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13777 } else {
13778 __tmp.len()
13779 }
13780 }
13781}
13782#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13783#[doc = ""]
13784#[doc = "ID: 63"]
13785#[derive(Debug, Clone, PartialEq)]
13786#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13788pub struct GLOBAL_POSITION_INT_COV_DATA {
13789 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13790 pub time_usec: u64,
13791 #[doc = "Latitude"]
13792 pub lat: i32,
13793 #[doc = "Longitude"]
13794 pub lon: i32,
13795 #[doc = "Altitude in meters above MSL"]
13796 pub alt: i32,
13797 #[doc = "Altitude above ground"]
13798 pub relative_alt: i32,
13799 #[doc = "Ground X Speed (Latitude)"]
13800 pub vx: f32,
13801 #[doc = "Ground Y Speed (Longitude)"]
13802 pub vy: f32,
13803 #[doc = "Ground Z Speed (Altitude)"]
13804 pub vz: f32,
13805 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13806 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13807 pub covariance: [f32; 36],
13808 #[doc = "Class id of the estimator this estimate originated from."]
13809 pub estimator_type: MavEstimatorType,
13810}
13811impl GLOBAL_POSITION_INT_COV_DATA {
13812 pub const ENCODED_LEN: usize = 181usize;
13813 pub const DEFAULT: Self = Self {
13814 time_usec: 0_u64,
13815 lat: 0_i32,
13816 lon: 0_i32,
13817 alt: 0_i32,
13818 relative_alt: 0_i32,
13819 vx: 0.0_f32,
13820 vy: 0.0_f32,
13821 vz: 0.0_f32,
13822 covariance: [0.0_f32; 36usize],
13823 estimator_type: MavEstimatorType::DEFAULT,
13824 };
13825 #[cfg(feature = "arbitrary")]
13826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13827 use arbitrary::{Arbitrary, Unstructured};
13828 let mut buf = [0u8; 1024];
13829 rng.fill_bytes(&mut buf);
13830 let mut unstructured = Unstructured::new(&buf);
13831 Self::arbitrary(&mut unstructured).unwrap_or_default()
13832 }
13833}
13834impl Default for GLOBAL_POSITION_INT_COV_DATA {
13835 fn default() -> Self {
13836 Self::DEFAULT.clone()
13837 }
13838}
13839impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13840 type Message = MavMessage;
13841 const ID: u32 = 63u32;
13842 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13843 const EXTRA_CRC: u8 = 119u8;
13844 const ENCODED_LEN: usize = 181usize;
13845 fn deser(
13846 _version: MavlinkVersion,
13847 __input: &[u8],
13848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13849 let avail_len = __input.len();
13850 let mut payload_buf = [0; Self::ENCODED_LEN];
13851 let mut buf = if avail_len < Self::ENCODED_LEN {
13852 payload_buf[0..avail_len].copy_from_slice(__input);
13853 Bytes::new(&payload_buf)
13854 } else {
13855 Bytes::new(__input)
13856 };
13857 let mut __struct = Self::default();
13858 __struct.time_usec = buf.get_u64_le();
13859 __struct.lat = buf.get_i32_le();
13860 __struct.lon = buf.get_i32_le();
13861 __struct.alt = buf.get_i32_le();
13862 __struct.relative_alt = buf.get_i32_le();
13863 __struct.vx = buf.get_f32_le();
13864 __struct.vy = buf.get_f32_le();
13865 __struct.vz = buf.get_f32_le();
13866 for v in &mut __struct.covariance {
13867 let val = buf.get_f32_le();
13868 *v = val;
13869 }
13870 let tmp = buf.get_u8();
13871 __struct.estimator_type =
13872 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13873 enum_type: "MavEstimatorType",
13874 value: tmp as u32,
13875 })?;
13876 Ok(__struct)
13877 }
13878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13879 let mut __tmp = BytesMut::new(bytes);
13880 #[allow(clippy::absurd_extreme_comparisons)]
13881 #[allow(unused_comparisons)]
13882 if __tmp.remaining() < Self::ENCODED_LEN {
13883 panic!(
13884 "buffer is too small (need {} bytes, but got {})",
13885 Self::ENCODED_LEN,
13886 __tmp.remaining(),
13887 )
13888 }
13889 __tmp.put_u64_le(self.time_usec);
13890 __tmp.put_i32_le(self.lat);
13891 __tmp.put_i32_le(self.lon);
13892 __tmp.put_i32_le(self.alt);
13893 __tmp.put_i32_le(self.relative_alt);
13894 __tmp.put_f32_le(self.vx);
13895 __tmp.put_f32_le(self.vy);
13896 __tmp.put_f32_le(self.vz);
13897 for val in &self.covariance {
13898 __tmp.put_f32_le(*val);
13899 }
13900 __tmp.put_u8(self.estimator_type as u8);
13901 if matches!(version, MavlinkVersion::V2) {
13902 let len = __tmp.len();
13903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13904 } else {
13905 __tmp.len()
13906 }
13907 }
13908}
13909#[doc = "Global position/attitude estimate from a vision source."]
13910#[doc = ""]
13911#[doc = "ID: 101"]
13912#[derive(Debug, Clone, PartialEq)]
13913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13915pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13916 #[doc = "Timestamp (UNIX time or since system boot)"]
13917 pub usec: u64,
13918 #[doc = "Global X position"]
13919 pub x: f32,
13920 #[doc = "Global Y position"]
13921 pub y: f32,
13922 #[doc = "Global Z position"]
13923 pub z: f32,
13924 #[doc = "Roll angle"]
13925 pub roll: f32,
13926 #[doc = "Pitch angle"]
13927 pub pitch: f32,
13928 #[doc = "Yaw angle"]
13929 pub yaw: f32,
13930 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13931 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13932 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13933 pub covariance: [f32; 21],
13934 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13935 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13936 pub reset_counter: u8,
13937}
13938impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13939 pub const ENCODED_LEN: usize = 117usize;
13940 pub const DEFAULT: Self = Self {
13941 usec: 0_u64,
13942 x: 0.0_f32,
13943 y: 0.0_f32,
13944 z: 0.0_f32,
13945 roll: 0.0_f32,
13946 pitch: 0.0_f32,
13947 yaw: 0.0_f32,
13948 covariance: [0.0_f32; 21usize],
13949 reset_counter: 0_u8,
13950 };
13951 #[cfg(feature = "arbitrary")]
13952 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13953 use arbitrary::{Arbitrary, Unstructured};
13954 let mut buf = [0u8; 1024];
13955 rng.fill_bytes(&mut buf);
13956 let mut unstructured = Unstructured::new(&buf);
13957 Self::arbitrary(&mut unstructured).unwrap_or_default()
13958 }
13959}
13960impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13961 fn default() -> Self {
13962 Self::DEFAULT.clone()
13963 }
13964}
13965impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13966 type Message = MavMessage;
13967 const ID: u32 = 101u32;
13968 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13969 const EXTRA_CRC: u8 = 102u8;
13970 const ENCODED_LEN: usize = 117usize;
13971 fn deser(
13972 _version: MavlinkVersion,
13973 __input: &[u8],
13974 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13975 let avail_len = __input.len();
13976 let mut payload_buf = [0; Self::ENCODED_LEN];
13977 let mut buf = if avail_len < Self::ENCODED_LEN {
13978 payload_buf[0..avail_len].copy_from_slice(__input);
13979 Bytes::new(&payload_buf)
13980 } else {
13981 Bytes::new(__input)
13982 };
13983 let mut __struct = Self::default();
13984 __struct.usec = buf.get_u64_le();
13985 __struct.x = buf.get_f32_le();
13986 __struct.y = buf.get_f32_le();
13987 __struct.z = buf.get_f32_le();
13988 __struct.roll = buf.get_f32_le();
13989 __struct.pitch = buf.get_f32_le();
13990 __struct.yaw = buf.get_f32_le();
13991 for v in &mut __struct.covariance {
13992 let val = buf.get_f32_le();
13993 *v = val;
13994 }
13995 __struct.reset_counter = buf.get_u8();
13996 Ok(__struct)
13997 }
13998 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13999 let mut __tmp = BytesMut::new(bytes);
14000 #[allow(clippy::absurd_extreme_comparisons)]
14001 #[allow(unused_comparisons)]
14002 if __tmp.remaining() < Self::ENCODED_LEN {
14003 panic!(
14004 "buffer is too small (need {} bytes, but got {})",
14005 Self::ENCODED_LEN,
14006 __tmp.remaining(),
14007 )
14008 }
14009 __tmp.put_u64_le(self.usec);
14010 __tmp.put_f32_le(self.x);
14011 __tmp.put_f32_le(self.y);
14012 __tmp.put_f32_le(self.z);
14013 __tmp.put_f32_le(self.roll);
14014 __tmp.put_f32_le(self.pitch);
14015 __tmp.put_f32_le(self.yaw);
14016 if matches!(version, MavlinkVersion::V2) {
14017 for val in &self.covariance {
14018 __tmp.put_f32_le(*val);
14019 }
14020 __tmp.put_u8(self.reset_counter);
14021 let len = __tmp.len();
14022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14023 } else {
14024 __tmp.len()
14025 }
14026 }
14027}
14028#[doc = "Second GPS data."]
14029#[doc = ""]
14030#[doc = "ID: 124"]
14031#[derive(Debug, Clone, PartialEq)]
14032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14034pub struct GPS2_RAW_DATA {
14035 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14036 pub time_usec: u64,
14037 #[doc = "Latitude (WGS84)"]
14038 pub lat: i32,
14039 #[doc = "Longitude (WGS84)"]
14040 pub lon: i32,
14041 #[doc = "Altitude (MSL). Positive for up."]
14042 pub alt: i32,
14043 #[doc = "Age of DGPS info"]
14044 pub dgps_age: u32,
14045 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14046 pub eph: u16,
14047 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14048 pub epv: u16,
14049 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14050 pub vel: u16,
14051 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14052 pub cog: u16,
14053 #[doc = "GPS fix type."]
14054 pub fix_type: GpsFixType,
14055 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14056 pub satellites_visible: u8,
14057 #[doc = "Number of DGPS satellites"]
14058 pub dgps_numch: u8,
14059 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14060 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14061 pub yaw: u16,
14062 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14063 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14064 pub alt_ellipsoid: i32,
14065 #[doc = "Position uncertainty."]
14066 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14067 pub h_acc: u32,
14068 #[doc = "Altitude uncertainty."]
14069 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14070 pub v_acc: u32,
14071 #[doc = "Speed uncertainty."]
14072 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14073 pub vel_acc: u32,
14074 #[doc = "Heading / track uncertainty"]
14075 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14076 pub hdg_acc: u32,
14077}
14078impl GPS2_RAW_DATA {
14079 pub const ENCODED_LEN: usize = 57usize;
14080 pub const DEFAULT: Self = Self {
14081 time_usec: 0_u64,
14082 lat: 0_i32,
14083 lon: 0_i32,
14084 alt: 0_i32,
14085 dgps_age: 0_u32,
14086 eph: 0_u16,
14087 epv: 0_u16,
14088 vel: 0_u16,
14089 cog: 0_u16,
14090 fix_type: GpsFixType::DEFAULT,
14091 satellites_visible: 0_u8,
14092 dgps_numch: 0_u8,
14093 yaw: 0_u16,
14094 alt_ellipsoid: 0_i32,
14095 h_acc: 0_u32,
14096 v_acc: 0_u32,
14097 vel_acc: 0_u32,
14098 hdg_acc: 0_u32,
14099 };
14100 #[cfg(feature = "arbitrary")]
14101 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14102 use arbitrary::{Arbitrary, Unstructured};
14103 let mut buf = [0u8; 1024];
14104 rng.fill_bytes(&mut buf);
14105 let mut unstructured = Unstructured::new(&buf);
14106 Self::arbitrary(&mut unstructured).unwrap_or_default()
14107 }
14108}
14109impl Default for GPS2_RAW_DATA {
14110 fn default() -> Self {
14111 Self::DEFAULT.clone()
14112 }
14113}
14114impl MessageData for GPS2_RAW_DATA {
14115 type Message = MavMessage;
14116 const ID: u32 = 124u32;
14117 const NAME: &'static str = "GPS2_RAW";
14118 const EXTRA_CRC: u8 = 87u8;
14119 const ENCODED_LEN: usize = 57usize;
14120 fn deser(
14121 _version: MavlinkVersion,
14122 __input: &[u8],
14123 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14124 let avail_len = __input.len();
14125 let mut payload_buf = [0; Self::ENCODED_LEN];
14126 let mut buf = if avail_len < Self::ENCODED_LEN {
14127 payload_buf[0..avail_len].copy_from_slice(__input);
14128 Bytes::new(&payload_buf)
14129 } else {
14130 Bytes::new(__input)
14131 };
14132 let mut __struct = Self::default();
14133 __struct.time_usec = buf.get_u64_le();
14134 __struct.lat = buf.get_i32_le();
14135 __struct.lon = buf.get_i32_le();
14136 __struct.alt = buf.get_i32_le();
14137 __struct.dgps_age = buf.get_u32_le();
14138 __struct.eph = buf.get_u16_le();
14139 __struct.epv = buf.get_u16_le();
14140 __struct.vel = buf.get_u16_le();
14141 __struct.cog = buf.get_u16_le();
14142 let tmp = buf.get_u8();
14143 __struct.fix_type =
14144 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14145 enum_type: "GpsFixType",
14146 value: tmp as u32,
14147 })?;
14148 __struct.satellites_visible = buf.get_u8();
14149 __struct.dgps_numch = buf.get_u8();
14150 __struct.yaw = buf.get_u16_le();
14151 __struct.alt_ellipsoid = buf.get_i32_le();
14152 __struct.h_acc = buf.get_u32_le();
14153 __struct.v_acc = buf.get_u32_le();
14154 __struct.vel_acc = buf.get_u32_le();
14155 __struct.hdg_acc = buf.get_u32_le();
14156 Ok(__struct)
14157 }
14158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14159 let mut __tmp = BytesMut::new(bytes);
14160 #[allow(clippy::absurd_extreme_comparisons)]
14161 #[allow(unused_comparisons)]
14162 if __tmp.remaining() < Self::ENCODED_LEN {
14163 panic!(
14164 "buffer is too small (need {} bytes, but got {})",
14165 Self::ENCODED_LEN,
14166 __tmp.remaining(),
14167 )
14168 }
14169 __tmp.put_u64_le(self.time_usec);
14170 __tmp.put_i32_le(self.lat);
14171 __tmp.put_i32_le(self.lon);
14172 __tmp.put_i32_le(self.alt);
14173 __tmp.put_u32_le(self.dgps_age);
14174 __tmp.put_u16_le(self.eph);
14175 __tmp.put_u16_le(self.epv);
14176 __tmp.put_u16_le(self.vel);
14177 __tmp.put_u16_le(self.cog);
14178 __tmp.put_u8(self.fix_type as u8);
14179 __tmp.put_u8(self.satellites_visible);
14180 __tmp.put_u8(self.dgps_numch);
14181 if matches!(version, MavlinkVersion::V2) {
14182 __tmp.put_u16_le(self.yaw);
14183 __tmp.put_i32_le(self.alt_ellipsoid);
14184 __tmp.put_u32_le(self.h_acc);
14185 __tmp.put_u32_le(self.v_acc);
14186 __tmp.put_u32_le(self.vel_acc);
14187 __tmp.put_u32_le(self.hdg_acc);
14188 let len = __tmp.len();
14189 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14190 } else {
14191 __tmp.len()
14192 }
14193 }
14194}
14195#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14196#[doc = ""]
14197#[doc = "ID: 128"]
14198#[derive(Debug, Clone, PartialEq)]
14199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14201pub struct GPS2_RTK_DATA {
14202 #[doc = "Time since boot of last baseline message received."]
14203 pub time_last_baseline_ms: u32,
14204 #[doc = "GPS Time of Week of last baseline"]
14205 pub tow: u32,
14206 #[doc = "Current baseline in ECEF x or NED north component."]
14207 pub baseline_a_mm: i32,
14208 #[doc = "Current baseline in ECEF y or NED east component."]
14209 pub baseline_b_mm: i32,
14210 #[doc = "Current baseline in ECEF z or NED down component."]
14211 pub baseline_c_mm: i32,
14212 #[doc = "Current estimate of baseline accuracy."]
14213 pub accuracy: u32,
14214 #[doc = "Current number of integer ambiguity hypotheses."]
14215 pub iar_num_hypotheses: i32,
14216 #[doc = "GPS Week Number of last baseline"]
14217 pub wn: u16,
14218 #[doc = "Identification of connected RTK receiver."]
14219 pub rtk_receiver_id: u8,
14220 #[doc = "GPS-specific health report for RTK data."]
14221 pub rtk_health: u8,
14222 #[doc = "Rate of baseline messages being received by GPS"]
14223 pub rtk_rate: u8,
14224 #[doc = "Current number of sats used for RTK calculation."]
14225 pub nsats: u8,
14226 #[doc = "Coordinate system of baseline"]
14227 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14228}
14229impl GPS2_RTK_DATA {
14230 pub const ENCODED_LEN: usize = 35usize;
14231 pub const DEFAULT: Self = Self {
14232 time_last_baseline_ms: 0_u32,
14233 tow: 0_u32,
14234 baseline_a_mm: 0_i32,
14235 baseline_b_mm: 0_i32,
14236 baseline_c_mm: 0_i32,
14237 accuracy: 0_u32,
14238 iar_num_hypotheses: 0_i32,
14239 wn: 0_u16,
14240 rtk_receiver_id: 0_u8,
14241 rtk_health: 0_u8,
14242 rtk_rate: 0_u8,
14243 nsats: 0_u8,
14244 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14245 };
14246 #[cfg(feature = "arbitrary")]
14247 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14248 use arbitrary::{Arbitrary, Unstructured};
14249 let mut buf = [0u8; 1024];
14250 rng.fill_bytes(&mut buf);
14251 let mut unstructured = Unstructured::new(&buf);
14252 Self::arbitrary(&mut unstructured).unwrap_or_default()
14253 }
14254}
14255impl Default for GPS2_RTK_DATA {
14256 fn default() -> Self {
14257 Self::DEFAULT.clone()
14258 }
14259}
14260impl MessageData for GPS2_RTK_DATA {
14261 type Message = MavMessage;
14262 const ID: u32 = 128u32;
14263 const NAME: &'static str = "GPS2_RTK";
14264 const EXTRA_CRC: u8 = 226u8;
14265 const ENCODED_LEN: usize = 35usize;
14266 fn deser(
14267 _version: MavlinkVersion,
14268 __input: &[u8],
14269 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14270 let avail_len = __input.len();
14271 let mut payload_buf = [0; Self::ENCODED_LEN];
14272 let mut buf = if avail_len < Self::ENCODED_LEN {
14273 payload_buf[0..avail_len].copy_from_slice(__input);
14274 Bytes::new(&payload_buf)
14275 } else {
14276 Bytes::new(__input)
14277 };
14278 let mut __struct = Self::default();
14279 __struct.time_last_baseline_ms = buf.get_u32_le();
14280 __struct.tow = buf.get_u32_le();
14281 __struct.baseline_a_mm = buf.get_i32_le();
14282 __struct.baseline_b_mm = buf.get_i32_le();
14283 __struct.baseline_c_mm = buf.get_i32_le();
14284 __struct.accuracy = buf.get_u32_le();
14285 __struct.iar_num_hypotheses = buf.get_i32_le();
14286 __struct.wn = buf.get_u16_le();
14287 __struct.rtk_receiver_id = buf.get_u8();
14288 __struct.rtk_health = buf.get_u8();
14289 __struct.rtk_rate = buf.get_u8();
14290 __struct.nsats = buf.get_u8();
14291 let tmp = buf.get_u8();
14292 __struct.baseline_coords_type =
14293 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14294 enum_type: "RtkBaselineCoordinateSystem",
14295 value: tmp as u32,
14296 })?;
14297 Ok(__struct)
14298 }
14299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14300 let mut __tmp = BytesMut::new(bytes);
14301 #[allow(clippy::absurd_extreme_comparisons)]
14302 #[allow(unused_comparisons)]
14303 if __tmp.remaining() < Self::ENCODED_LEN {
14304 panic!(
14305 "buffer is too small (need {} bytes, but got {})",
14306 Self::ENCODED_LEN,
14307 __tmp.remaining(),
14308 )
14309 }
14310 __tmp.put_u32_le(self.time_last_baseline_ms);
14311 __tmp.put_u32_le(self.tow);
14312 __tmp.put_i32_le(self.baseline_a_mm);
14313 __tmp.put_i32_le(self.baseline_b_mm);
14314 __tmp.put_i32_le(self.baseline_c_mm);
14315 __tmp.put_u32_le(self.accuracy);
14316 __tmp.put_i32_le(self.iar_num_hypotheses);
14317 __tmp.put_u16_le(self.wn);
14318 __tmp.put_u8(self.rtk_receiver_id);
14319 __tmp.put_u8(self.rtk_health);
14320 __tmp.put_u8(self.rtk_rate);
14321 __tmp.put_u8(self.nsats);
14322 __tmp.put_u8(self.baseline_coords_type as u8);
14323 if matches!(version, MavlinkVersion::V2) {
14324 let len = __tmp.len();
14325 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14326 } else {
14327 __tmp.len()
14328 }
14329 }
14330}
14331#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14332#[doc = ""]
14333#[doc = "ID: 49"]
14334#[derive(Debug, Clone, PartialEq)]
14335#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14336#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14337pub struct GPS_GLOBAL_ORIGIN_DATA {
14338 #[doc = "Latitude (WGS84)"]
14339 pub latitude: i32,
14340 #[doc = "Longitude (WGS84)"]
14341 pub longitude: i32,
14342 #[doc = "Altitude (MSL). Positive for up."]
14343 pub altitude: i32,
14344 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14345 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14346 pub time_usec: u64,
14347}
14348impl GPS_GLOBAL_ORIGIN_DATA {
14349 pub const ENCODED_LEN: usize = 20usize;
14350 pub const DEFAULT: Self = Self {
14351 latitude: 0_i32,
14352 longitude: 0_i32,
14353 altitude: 0_i32,
14354 time_usec: 0_u64,
14355 };
14356 #[cfg(feature = "arbitrary")]
14357 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14358 use arbitrary::{Arbitrary, Unstructured};
14359 let mut buf = [0u8; 1024];
14360 rng.fill_bytes(&mut buf);
14361 let mut unstructured = Unstructured::new(&buf);
14362 Self::arbitrary(&mut unstructured).unwrap_or_default()
14363 }
14364}
14365impl Default for GPS_GLOBAL_ORIGIN_DATA {
14366 fn default() -> Self {
14367 Self::DEFAULT.clone()
14368 }
14369}
14370impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14371 type Message = MavMessage;
14372 const ID: u32 = 49u32;
14373 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14374 const EXTRA_CRC: u8 = 39u8;
14375 const ENCODED_LEN: usize = 20usize;
14376 fn deser(
14377 _version: MavlinkVersion,
14378 __input: &[u8],
14379 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14380 let avail_len = __input.len();
14381 let mut payload_buf = [0; Self::ENCODED_LEN];
14382 let mut buf = if avail_len < Self::ENCODED_LEN {
14383 payload_buf[0..avail_len].copy_from_slice(__input);
14384 Bytes::new(&payload_buf)
14385 } else {
14386 Bytes::new(__input)
14387 };
14388 let mut __struct = Self::default();
14389 __struct.latitude = buf.get_i32_le();
14390 __struct.longitude = buf.get_i32_le();
14391 __struct.altitude = buf.get_i32_le();
14392 __struct.time_usec = buf.get_u64_le();
14393 Ok(__struct)
14394 }
14395 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14396 let mut __tmp = BytesMut::new(bytes);
14397 #[allow(clippy::absurd_extreme_comparisons)]
14398 #[allow(unused_comparisons)]
14399 if __tmp.remaining() < Self::ENCODED_LEN {
14400 panic!(
14401 "buffer is too small (need {} bytes, but got {})",
14402 Self::ENCODED_LEN,
14403 __tmp.remaining(),
14404 )
14405 }
14406 __tmp.put_i32_le(self.latitude);
14407 __tmp.put_i32_le(self.longitude);
14408 __tmp.put_i32_le(self.altitude);
14409 if matches!(version, MavlinkVersion::V2) {
14410 __tmp.put_u64_le(self.time_usec);
14411 let len = __tmp.len();
14412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14413 } else {
14414 __tmp.len()
14415 }
14416 }
14417}
14418#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14419#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14420#[doc = ""]
14421#[doc = "ID: 123"]
14422#[derive(Debug, Clone, PartialEq)]
14423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14425pub struct GPS_INJECT_DATA_DATA {
14426 #[doc = "System ID"]
14427 pub target_system: u8,
14428 #[doc = "Component ID"]
14429 pub target_component: u8,
14430 #[doc = "Data length"]
14431 pub len: u8,
14432 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14433 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14434 pub data: [u8; 110],
14435}
14436impl GPS_INJECT_DATA_DATA {
14437 pub const ENCODED_LEN: usize = 113usize;
14438 pub const DEFAULT: Self = Self {
14439 target_system: 0_u8,
14440 target_component: 0_u8,
14441 len: 0_u8,
14442 data: [0_u8; 110usize],
14443 };
14444 #[cfg(feature = "arbitrary")]
14445 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14446 use arbitrary::{Arbitrary, Unstructured};
14447 let mut buf = [0u8; 1024];
14448 rng.fill_bytes(&mut buf);
14449 let mut unstructured = Unstructured::new(&buf);
14450 Self::arbitrary(&mut unstructured).unwrap_or_default()
14451 }
14452}
14453impl Default for GPS_INJECT_DATA_DATA {
14454 fn default() -> Self {
14455 Self::DEFAULT.clone()
14456 }
14457}
14458impl MessageData for GPS_INJECT_DATA_DATA {
14459 type Message = MavMessage;
14460 const ID: u32 = 123u32;
14461 const NAME: &'static str = "GPS_INJECT_DATA";
14462 const EXTRA_CRC: u8 = 250u8;
14463 const ENCODED_LEN: usize = 113usize;
14464 fn deser(
14465 _version: MavlinkVersion,
14466 __input: &[u8],
14467 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14468 let avail_len = __input.len();
14469 let mut payload_buf = [0; Self::ENCODED_LEN];
14470 let mut buf = if avail_len < Self::ENCODED_LEN {
14471 payload_buf[0..avail_len].copy_from_slice(__input);
14472 Bytes::new(&payload_buf)
14473 } else {
14474 Bytes::new(__input)
14475 };
14476 let mut __struct = Self::default();
14477 __struct.target_system = buf.get_u8();
14478 __struct.target_component = buf.get_u8();
14479 __struct.len = buf.get_u8();
14480 for v in &mut __struct.data {
14481 let val = buf.get_u8();
14482 *v = val;
14483 }
14484 Ok(__struct)
14485 }
14486 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14487 let mut __tmp = BytesMut::new(bytes);
14488 #[allow(clippy::absurd_extreme_comparisons)]
14489 #[allow(unused_comparisons)]
14490 if __tmp.remaining() < Self::ENCODED_LEN {
14491 panic!(
14492 "buffer is too small (need {} bytes, but got {})",
14493 Self::ENCODED_LEN,
14494 __tmp.remaining(),
14495 )
14496 }
14497 __tmp.put_u8(self.target_system);
14498 __tmp.put_u8(self.target_component);
14499 __tmp.put_u8(self.len);
14500 for val in &self.data {
14501 __tmp.put_u8(*val);
14502 }
14503 if matches!(version, MavlinkVersion::V2) {
14504 let len = __tmp.len();
14505 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14506 } else {
14507 __tmp.len()
14508 }
14509 }
14510}
14511#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14512#[doc = ""]
14513#[doc = "ID: 232"]
14514#[derive(Debug, Clone, PartialEq)]
14515#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14517pub struct GPS_INPUT_DATA {
14518 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14519 pub time_usec: u64,
14520 #[doc = "GPS time (from start of GPS week)"]
14521 pub time_week_ms: u32,
14522 #[doc = "Latitude (WGS84)"]
14523 pub lat: i32,
14524 #[doc = "Longitude (WGS84)"]
14525 pub lon: i32,
14526 #[doc = "Altitude (MSL). Positive for up."]
14527 pub alt: f32,
14528 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14529 pub hdop: f32,
14530 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14531 pub vdop: f32,
14532 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14533 pub vn: f32,
14534 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14535 pub ve: f32,
14536 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14537 pub vd: f32,
14538 #[doc = "GPS speed accuracy"]
14539 pub speed_accuracy: f32,
14540 #[doc = "GPS horizontal accuracy"]
14541 pub horiz_accuracy: f32,
14542 #[doc = "GPS vertical accuracy"]
14543 pub vert_accuracy: f32,
14544 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14545 pub ignore_flags: GpsInputIgnoreFlags,
14546 #[doc = "GPS week number"]
14547 pub time_week: u16,
14548 #[doc = "ID of the GPS for multiple GPS inputs"]
14549 pub gps_id: u8,
14550 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14551 pub fix_type: u8,
14552 #[doc = "Number of satellites visible."]
14553 pub satellites_visible: u8,
14554 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14555 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14556 pub yaw: u16,
14557}
14558impl GPS_INPUT_DATA {
14559 pub const ENCODED_LEN: usize = 65usize;
14560 pub const DEFAULT: Self = Self {
14561 time_usec: 0_u64,
14562 time_week_ms: 0_u32,
14563 lat: 0_i32,
14564 lon: 0_i32,
14565 alt: 0.0_f32,
14566 hdop: 0.0_f32,
14567 vdop: 0.0_f32,
14568 vn: 0.0_f32,
14569 ve: 0.0_f32,
14570 vd: 0.0_f32,
14571 speed_accuracy: 0.0_f32,
14572 horiz_accuracy: 0.0_f32,
14573 vert_accuracy: 0.0_f32,
14574 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14575 time_week: 0_u16,
14576 gps_id: 0_u8,
14577 fix_type: 0_u8,
14578 satellites_visible: 0_u8,
14579 yaw: 0_u16,
14580 };
14581 #[cfg(feature = "arbitrary")]
14582 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14583 use arbitrary::{Arbitrary, Unstructured};
14584 let mut buf = [0u8; 1024];
14585 rng.fill_bytes(&mut buf);
14586 let mut unstructured = Unstructured::new(&buf);
14587 Self::arbitrary(&mut unstructured).unwrap_or_default()
14588 }
14589}
14590impl Default for GPS_INPUT_DATA {
14591 fn default() -> Self {
14592 Self::DEFAULT.clone()
14593 }
14594}
14595impl MessageData for GPS_INPUT_DATA {
14596 type Message = MavMessage;
14597 const ID: u32 = 232u32;
14598 const NAME: &'static str = "GPS_INPUT";
14599 const EXTRA_CRC: u8 = 151u8;
14600 const ENCODED_LEN: usize = 65usize;
14601 fn deser(
14602 _version: MavlinkVersion,
14603 __input: &[u8],
14604 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14605 let avail_len = __input.len();
14606 let mut payload_buf = [0; Self::ENCODED_LEN];
14607 let mut buf = if avail_len < Self::ENCODED_LEN {
14608 payload_buf[0..avail_len].copy_from_slice(__input);
14609 Bytes::new(&payload_buf)
14610 } else {
14611 Bytes::new(__input)
14612 };
14613 let mut __struct = Self::default();
14614 __struct.time_usec = buf.get_u64_le();
14615 __struct.time_week_ms = buf.get_u32_le();
14616 __struct.lat = buf.get_i32_le();
14617 __struct.lon = buf.get_i32_le();
14618 __struct.alt = buf.get_f32_le();
14619 __struct.hdop = buf.get_f32_le();
14620 __struct.vdop = buf.get_f32_le();
14621 __struct.vn = buf.get_f32_le();
14622 __struct.ve = buf.get_f32_le();
14623 __struct.vd = buf.get_f32_le();
14624 __struct.speed_accuracy = buf.get_f32_le();
14625 __struct.horiz_accuracy = buf.get_f32_le();
14626 __struct.vert_accuracy = buf.get_f32_le();
14627 let tmp = buf.get_u16_le();
14628 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14629 tmp & GpsInputIgnoreFlags::all().bits(),
14630 )
14631 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14632 flag_type: "GpsInputIgnoreFlags",
14633 value: tmp as u32,
14634 })?;
14635 __struct.time_week = buf.get_u16_le();
14636 __struct.gps_id = buf.get_u8();
14637 __struct.fix_type = buf.get_u8();
14638 __struct.satellites_visible = buf.get_u8();
14639 __struct.yaw = buf.get_u16_le();
14640 Ok(__struct)
14641 }
14642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14643 let mut __tmp = BytesMut::new(bytes);
14644 #[allow(clippy::absurd_extreme_comparisons)]
14645 #[allow(unused_comparisons)]
14646 if __tmp.remaining() < Self::ENCODED_LEN {
14647 panic!(
14648 "buffer is too small (need {} bytes, but got {})",
14649 Self::ENCODED_LEN,
14650 __tmp.remaining(),
14651 )
14652 }
14653 __tmp.put_u64_le(self.time_usec);
14654 __tmp.put_u32_le(self.time_week_ms);
14655 __tmp.put_i32_le(self.lat);
14656 __tmp.put_i32_le(self.lon);
14657 __tmp.put_f32_le(self.alt);
14658 __tmp.put_f32_le(self.hdop);
14659 __tmp.put_f32_le(self.vdop);
14660 __tmp.put_f32_le(self.vn);
14661 __tmp.put_f32_le(self.ve);
14662 __tmp.put_f32_le(self.vd);
14663 __tmp.put_f32_le(self.speed_accuracy);
14664 __tmp.put_f32_le(self.horiz_accuracy);
14665 __tmp.put_f32_le(self.vert_accuracy);
14666 __tmp.put_u16_le(self.ignore_flags.bits());
14667 __tmp.put_u16_le(self.time_week);
14668 __tmp.put_u8(self.gps_id);
14669 __tmp.put_u8(self.fix_type);
14670 __tmp.put_u8(self.satellites_visible);
14671 if matches!(version, MavlinkVersion::V2) {
14672 __tmp.put_u16_le(self.yaw);
14673 let len = __tmp.len();
14674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14675 } else {
14676 __tmp.len()
14677 }
14678 }
14679}
14680#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14681#[doc = ""]
14682#[doc = "ID: 24"]
14683#[derive(Debug, Clone, PartialEq)]
14684#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14685#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14686pub struct GPS_RAW_INT_DATA {
14687 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14688 pub time_usec: u64,
14689 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14690 pub lat: i32,
14691 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14692 pub lon: i32,
14693 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14694 pub alt: i32,
14695 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14696 pub eph: u16,
14697 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14698 pub epv: u16,
14699 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14700 pub vel: u16,
14701 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14702 pub cog: u16,
14703 #[doc = "GPS fix type."]
14704 pub fix_type: GpsFixType,
14705 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14706 pub satellites_visible: u8,
14707 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14708 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14709 pub alt_ellipsoid: i32,
14710 #[doc = "Position uncertainty."]
14711 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14712 pub h_acc: u32,
14713 #[doc = "Altitude uncertainty."]
14714 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14715 pub v_acc: u32,
14716 #[doc = "Speed uncertainty."]
14717 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14718 pub vel_acc: u32,
14719 #[doc = "Heading / track uncertainty"]
14720 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14721 pub hdg_acc: u32,
14722 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14723 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14724 pub yaw: u16,
14725}
14726impl GPS_RAW_INT_DATA {
14727 pub const ENCODED_LEN: usize = 52usize;
14728 pub const DEFAULT: Self = Self {
14729 time_usec: 0_u64,
14730 lat: 0_i32,
14731 lon: 0_i32,
14732 alt: 0_i32,
14733 eph: 0_u16,
14734 epv: 0_u16,
14735 vel: 0_u16,
14736 cog: 0_u16,
14737 fix_type: GpsFixType::DEFAULT,
14738 satellites_visible: 0_u8,
14739 alt_ellipsoid: 0_i32,
14740 h_acc: 0_u32,
14741 v_acc: 0_u32,
14742 vel_acc: 0_u32,
14743 hdg_acc: 0_u32,
14744 yaw: 0_u16,
14745 };
14746 #[cfg(feature = "arbitrary")]
14747 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14748 use arbitrary::{Arbitrary, Unstructured};
14749 let mut buf = [0u8; 1024];
14750 rng.fill_bytes(&mut buf);
14751 let mut unstructured = Unstructured::new(&buf);
14752 Self::arbitrary(&mut unstructured).unwrap_or_default()
14753 }
14754}
14755impl Default for GPS_RAW_INT_DATA {
14756 fn default() -> Self {
14757 Self::DEFAULT.clone()
14758 }
14759}
14760impl MessageData for GPS_RAW_INT_DATA {
14761 type Message = MavMessage;
14762 const ID: u32 = 24u32;
14763 const NAME: &'static str = "GPS_RAW_INT";
14764 const EXTRA_CRC: u8 = 24u8;
14765 const ENCODED_LEN: usize = 52usize;
14766 fn deser(
14767 _version: MavlinkVersion,
14768 __input: &[u8],
14769 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14770 let avail_len = __input.len();
14771 let mut payload_buf = [0; Self::ENCODED_LEN];
14772 let mut buf = if avail_len < Self::ENCODED_LEN {
14773 payload_buf[0..avail_len].copy_from_slice(__input);
14774 Bytes::new(&payload_buf)
14775 } else {
14776 Bytes::new(__input)
14777 };
14778 let mut __struct = Self::default();
14779 __struct.time_usec = buf.get_u64_le();
14780 __struct.lat = buf.get_i32_le();
14781 __struct.lon = buf.get_i32_le();
14782 __struct.alt = buf.get_i32_le();
14783 __struct.eph = buf.get_u16_le();
14784 __struct.epv = buf.get_u16_le();
14785 __struct.vel = buf.get_u16_le();
14786 __struct.cog = buf.get_u16_le();
14787 let tmp = buf.get_u8();
14788 __struct.fix_type =
14789 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14790 enum_type: "GpsFixType",
14791 value: tmp as u32,
14792 })?;
14793 __struct.satellites_visible = buf.get_u8();
14794 __struct.alt_ellipsoid = buf.get_i32_le();
14795 __struct.h_acc = buf.get_u32_le();
14796 __struct.v_acc = buf.get_u32_le();
14797 __struct.vel_acc = buf.get_u32_le();
14798 __struct.hdg_acc = buf.get_u32_le();
14799 __struct.yaw = buf.get_u16_le();
14800 Ok(__struct)
14801 }
14802 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14803 let mut __tmp = BytesMut::new(bytes);
14804 #[allow(clippy::absurd_extreme_comparisons)]
14805 #[allow(unused_comparisons)]
14806 if __tmp.remaining() < Self::ENCODED_LEN {
14807 panic!(
14808 "buffer is too small (need {} bytes, but got {})",
14809 Self::ENCODED_LEN,
14810 __tmp.remaining(),
14811 )
14812 }
14813 __tmp.put_u64_le(self.time_usec);
14814 __tmp.put_i32_le(self.lat);
14815 __tmp.put_i32_le(self.lon);
14816 __tmp.put_i32_le(self.alt);
14817 __tmp.put_u16_le(self.eph);
14818 __tmp.put_u16_le(self.epv);
14819 __tmp.put_u16_le(self.vel);
14820 __tmp.put_u16_le(self.cog);
14821 __tmp.put_u8(self.fix_type as u8);
14822 __tmp.put_u8(self.satellites_visible);
14823 if matches!(version, MavlinkVersion::V2) {
14824 __tmp.put_i32_le(self.alt_ellipsoid);
14825 __tmp.put_u32_le(self.h_acc);
14826 __tmp.put_u32_le(self.v_acc);
14827 __tmp.put_u32_le(self.vel_acc);
14828 __tmp.put_u32_le(self.hdg_acc);
14829 __tmp.put_u16_le(self.yaw);
14830 let len = __tmp.len();
14831 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14832 } else {
14833 __tmp.len()
14834 }
14835 }
14836}
14837#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14838#[doc = ""]
14839#[doc = "ID: 233"]
14840#[derive(Debug, Clone, PartialEq)]
14841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14843pub struct GPS_RTCM_DATA_DATA {
14844 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14845 pub flags: u8,
14846 #[doc = "data length"]
14847 pub len: u8,
14848 #[doc = "RTCM message (may be fragmented)"]
14849 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14850 pub data: [u8; 180],
14851}
14852impl GPS_RTCM_DATA_DATA {
14853 pub const ENCODED_LEN: usize = 182usize;
14854 pub const DEFAULT: Self = Self {
14855 flags: 0_u8,
14856 len: 0_u8,
14857 data: [0_u8; 180usize],
14858 };
14859 #[cfg(feature = "arbitrary")]
14860 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14861 use arbitrary::{Arbitrary, Unstructured};
14862 let mut buf = [0u8; 1024];
14863 rng.fill_bytes(&mut buf);
14864 let mut unstructured = Unstructured::new(&buf);
14865 Self::arbitrary(&mut unstructured).unwrap_or_default()
14866 }
14867}
14868impl Default for GPS_RTCM_DATA_DATA {
14869 fn default() -> Self {
14870 Self::DEFAULT.clone()
14871 }
14872}
14873impl MessageData for GPS_RTCM_DATA_DATA {
14874 type Message = MavMessage;
14875 const ID: u32 = 233u32;
14876 const NAME: &'static str = "GPS_RTCM_DATA";
14877 const EXTRA_CRC: u8 = 35u8;
14878 const ENCODED_LEN: usize = 182usize;
14879 fn deser(
14880 _version: MavlinkVersion,
14881 __input: &[u8],
14882 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14883 let avail_len = __input.len();
14884 let mut payload_buf = [0; Self::ENCODED_LEN];
14885 let mut buf = if avail_len < Self::ENCODED_LEN {
14886 payload_buf[0..avail_len].copy_from_slice(__input);
14887 Bytes::new(&payload_buf)
14888 } else {
14889 Bytes::new(__input)
14890 };
14891 let mut __struct = Self::default();
14892 __struct.flags = buf.get_u8();
14893 __struct.len = buf.get_u8();
14894 for v in &mut __struct.data {
14895 let val = buf.get_u8();
14896 *v = val;
14897 }
14898 Ok(__struct)
14899 }
14900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14901 let mut __tmp = BytesMut::new(bytes);
14902 #[allow(clippy::absurd_extreme_comparisons)]
14903 #[allow(unused_comparisons)]
14904 if __tmp.remaining() < Self::ENCODED_LEN {
14905 panic!(
14906 "buffer is too small (need {} bytes, but got {})",
14907 Self::ENCODED_LEN,
14908 __tmp.remaining(),
14909 )
14910 }
14911 __tmp.put_u8(self.flags);
14912 __tmp.put_u8(self.len);
14913 for val in &self.data {
14914 __tmp.put_u8(*val);
14915 }
14916 if matches!(version, MavlinkVersion::V2) {
14917 let len = __tmp.len();
14918 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14919 } else {
14920 __tmp.len()
14921 }
14922 }
14923}
14924#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14925#[doc = ""]
14926#[doc = "ID: 127"]
14927#[derive(Debug, Clone, PartialEq)]
14928#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14929#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14930pub struct GPS_RTK_DATA {
14931 #[doc = "Time since boot of last baseline message received."]
14932 pub time_last_baseline_ms: u32,
14933 #[doc = "GPS Time of Week of last baseline"]
14934 pub tow: u32,
14935 #[doc = "Current baseline in ECEF x or NED north component."]
14936 pub baseline_a_mm: i32,
14937 #[doc = "Current baseline in ECEF y or NED east component."]
14938 pub baseline_b_mm: i32,
14939 #[doc = "Current baseline in ECEF z or NED down component."]
14940 pub baseline_c_mm: i32,
14941 #[doc = "Current estimate of baseline accuracy."]
14942 pub accuracy: u32,
14943 #[doc = "Current number of integer ambiguity hypotheses."]
14944 pub iar_num_hypotheses: i32,
14945 #[doc = "GPS Week Number of last baseline"]
14946 pub wn: u16,
14947 #[doc = "Identification of connected RTK receiver."]
14948 pub rtk_receiver_id: u8,
14949 #[doc = "GPS-specific health report for RTK data."]
14950 pub rtk_health: u8,
14951 #[doc = "Rate of baseline messages being received by GPS"]
14952 pub rtk_rate: u8,
14953 #[doc = "Current number of sats used for RTK calculation."]
14954 pub nsats: u8,
14955 #[doc = "Coordinate system of baseline"]
14956 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14957}
14958impl GPS_RTK_DATA {
14959 pub const ENCODED_LEN: usize = 35usize;
14960 pub const DEFAULT: Self = Self {
14961 time_last_baseline_ms: 0_u32,
14962 tow: 0_u32,
14963 baseline_a_mm: 0_i32,
14964 baseline_b_mm: 0_i32,
14965 baseline_c_mm: 0_i32,
14966 accuracy: 0_u32,
14967 iar_num_hypotheses: 0_i32,
14968 wn: 0_u16,
14969 rtk_receiver_id: 0_u8,
14970 rtk_health: 0_u8,
14971 rtk_rate: 0_u8,
14972 nsats: 0_u8,
14973 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14974 };
14975 #[cfg(feature = "arbitrary")]
14976 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14977 use arbitrary::{Arbitrary, Unstructured};
14978 let mut buf = [0u8; 1024];
14979 rng.fill_bytes(&mut buf);
14980 let mut unstructured = Unstructured::new(&buf);
14981 Self::arbitrary(&mut unstructured).unwrap_or_default()
14982 }
14983}
14984impl Default for GPS_RTK_DATA {
14985 fn default() -> Self {
14986 Self::DEFAULT.clone()
14987 }
14988}
14989impl MessageData for GPS_RTK_DATA {
14990 type Message = MavMessage;
14991 const ID: u32 = 127u32;
14992 const NAME: &'static str = "GPS_RTK";
14993 const EXTRA_CRC: u8 = 25u8;
14994 const ENCODED_LEN: usize = 35usize;
14995 fn deser(
14996 _version: MavlinkVersion,
14997 __input: &[u8],
14998 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14999 let avail_len = __input.len();
15000 let mut payload_buf = [0; Self::ENCODED_LEN];
15001 let mut buf = if avail_len < Self::ENCODED_LEN {
15002 payload_buf[0..avail_len].copy_from_slice(__input);
15003 Bytes::new(&payload_buf)
15004 } else {
15005 Bytes::new(__input)
15006 };
15007 let mut __struct = Self::default();
15008 __struct.time_last_baseline_ms = buf.get_u32_le();
15009 __struct.tow = buf.get_u32_le();
15010 __struct.baseline_a_mm = buf.get_i32_le();
15011 __struct.baseline_b_mm = buf.get_i32_le();
15012 __struct.baseline_c_mm = buf.get_i32_le();
15013 __struct.accuracy = buf.get_u32_le();
15014 __struct.iar_num_hypotheses = buf.get_i32_le();
15015 __struct.wn = buf.get_u16_le();
15016 __struct.rtk_receiver_id = buf.get_u8();
15017 __struct.rtk_health = buf.get_u8();
15018 __struct.rtk_rate = buf.get_u8();
15019 __struct.nsats = buf.get_u8();
15020 let tmp = buf.get_u8();
15021 __struct.baseline_coords_type =
15022 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15023 enum_type: "RtkBaselineCoordinateSystem",
15024 value: tmp as u32,
15025 })?;
15026 Ok(__struct)
15027 }
15028 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15029 let mut __tmp = BytesMut::new(bytes);
15030 #[allow(clippy::absurd_extreme_comparisons)]
15031 #[allow(unused_comparisons)]
15032 if __tmp.remaining() < Self::ENCODED_LEN {
15033 panic!(
15034 "buffer is too small (need {} bytes, but got {})",
15035 Self::ENCODED_LEN,
15036 __tmp.remaining(),
15037 )
15038 }
15039 __tmp.put_u32_le(self.time_last_baseline_ms);
15040 __tmp.put_u32_le(self.tow);
15041 __tmp.put_i32_le(self.baseline_a_mm);
15042 __tmp.put_i32_le(self.baseline_b_mm);
15043 __tmp.put_i32_le(self.baseline_c_mm);
15044 __tmp.put_u32_le(self.accuracy);
15045 __tmp.put_i32_le(self.iar_num_hypotheses);
15046 __tmp.put_u16_le(self.wn);
15047 __tmp.put_u8(self.rtk_receiver_id);
15048 __tmp.put_u8(self.rtk_health);
15049 __tmp.put_u8(self.rtk_rate);
15050 __tmp.put_u8(self.nsats);
15051 __tmp.put_u8(self.baseline_coords_type as u8);
15052 if matches!(version, MavlinkVersion::V2) {
15053 let len = __tmp.len();
15054 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15055 } else {
15056 __tmp.len()
15057 }
15058 }
15059}
15060#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
15061#[doc = ""]
15062#[doc = "ID: 25"]
15063#[derive(Debug, Clone, PartialEq)]
15064#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15065#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15066pub struct GPS_STATUS_DATA {
15067 #[doc = "Number of satellites visible"]
15068 pub satellites_visible: u8,
15069 #[doc = "Global satellite ID"]
15070 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15071 pub satellite_prn: [u8; 20],
15072 #[doc = "0: Satellite not used, 1: used for localization"]
15073 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15074 pub satellite_used: [u8; 20],
15075 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
15076 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15077 pub satellite_elevation: [u8; 20],
15078 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
15079 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15080 pub satellite_azimuth: [u8; 20],
15081 #[doc = "Signal to noise ratio of satellite"]
15082 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15083 pub satellite_snr: [u8; 20],
15084}
15085impl GPS_STATUS_DATA {
15086 pub const ENCODED_LEN: usize = 101usize;
15087 pub const DEFAULT: Self = Self {
15088 satellites_visible: 0_u8,
15089 satellite_prn: [0_u8; 20usize],
15090 satellite_used: [0_u8; 20usize],
15091 satellite_elevation: [0_u8; 20usize],
15092 satellite_azimuth: [0_u8; 20usize],
15093 satellite_snr: [0_u8; 20usize],
15094 };
15095 #[cfg(feature = "arbitrary")]
15096 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15097 use arbitrary::{Arbitrary, Unstructured};
15098 let mut buf = [0u8; 1024];
15099 rng.fill_bytes(&mut buf);
15100 let mut unstructured = Unstructured::new(&buf);
15101 Self::arbitrary(&mut unstructured).unwrap_or_default()
15102 }
15103}
15104impl Default for GPS_STATUS_DATA {
15105 fn default() -> Self {
15106 Self::DEFAULT.clone()
15107 }
15108}
15109impl MessageData for GPS_STATUS_DATA {
15110 type Message = MavMessage;
15111 const ID: u32 = 25u32;
15112 const NAME: &'static str = "GPS_STATUS";
15113 const EXTRA_CRC: u8 = 23u8;
15114 const ENCODED_LEN: usize = 101usize;
15115 fn deser(
15116 _version: MavlinkVersion,
15117 __input: &[u8],
15118 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15119 let avail_len = __input.len();
15120 let mut payload_buf = [0; Self::ENCODED_LEN];
15121 let mut buf = if avail_len < Self::ENCODED_LEN {
15122 payload_buf[0..avail_len].copy_from_slice(__input);
15123 Bytes::new(&payload_buf)
15124 } else {
15125 Bytes::new(__input)
15126 };
15127 let mut __struct = Self::default();
15128 __struct.satellites_visible = buf.get_u8();
15129 for v in &mut __struct.satellite_prn {
15130 let val = buf.get_u8();
15131 *v = val;
15132 }
15133 for v in &mut __struct.satellite_used {
15134 let val = buf.get_u8();
15135 *v = val;
15136 }
15137 for v in &mut __struct.satellite_elevation {
15138 let val = buf.get_u8();
15139 *v = val;
15140 }
15141 for v in &mut __struct.satellite_azimuth {
15142 let val = buf.get_u8();
15143 *v = val;
15144 }
15145 for v in &mut __struct.satellite_snr {
15146 let val = buf.get_u8();
15147 *v = val;
15148 }
15149 Ok(__struct)
15150 }
15151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15152 let mut __tmp = BytesMut::new(bytes);
15153 #[allow(clippy::absurd_extreme_comparisons)]
15154 #[allow(unused_comparisons)]
15155 if __tmp.remaining() < Self::ENCODED_LEN {
15156 panic!(
15157 "buffer is too small (need {} bytes, but got {})",
15158 Self::ENCODED_LEN,
15159 __tmp.remaining(),
15160 )
15161 }
15162 __tmp.put_u8(self.satellites_visible);
15163 for val in &self.satellite_prn {
15164 __tmp.put_u8(*val);
15165 }
15166 for val in &self.satellite_used {
15167 __tmp.put_u8(*val);
15168 }
15169 for val in &self.satellite_elevation {
15170 __tmp.put_u8(*val);
15171 }
15172 for val in &self.satellite_azimuth {
15173 __tmp.put_u8(*val);
15174 }
15175 for val in &self.satellite_snr {
15176 __tmp.put_u8(*val);
15177 }
15178 if matches!(version, MavlinkVersion::V2) {
15179 let len = __tmp.len();
15180 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15181 } else {
15182 __tmp.len()
15183 }
15184 }
15185}
15186#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15187#[doc = ""]
15188#[doc = "ID: 0"]
15189#[derive(Debug, Clone, PartialEq)]
15190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15192pub struct HEARTBEAT_DATA {
15193 #[doc = "A bitfield for use for autopilot-specific flags"]
15194 pub custom_mode: u32,
15195 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15196 pub mavtype: MavType,
15197 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15198 pub autopilot: MavAutopilot,
15199 #[doc = "System mode bitmap."]
15200 pub base_mode: MavModeFlag,
15201 #[doc = "System status flag."]
15202 pub system_status: MavState,
15203 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15204 pub mavlink_version: u8,
15205}
15206impl HEARTBEAT_DATA {
15207 pub const ENCODED_LEN: usize = 9usize;
15208 pub const DEFAULT: Self = Self {
15209 custom_mode: 0_u32,
15210 mavtype: MavType::DEFAULT,
15211 autopilot: MavAutopilot::DEFAULT,
15212 base_mode: MavModeFlag::DEFAULT,
15213 system_status: MavState::DEFAULT,
15214 mavlink_version: MINOR_MAVLINK_VERSION,
15215 };
15216 #[cfg(feature = "arbitrary")]
15217 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15218 use arbitrary::{Arbitrary, Unstructured};
15219 let mut buf = [0u8; 1024];
15220 rng.fill_bytes(&mut buf);
15221 let mut unstructured = Unstructured::new(&buf);
15222 Self::arbitrary(&mut unstructured).unwrap_or_default()
15223 }
15224}
15225impl Default for HEARTBEAT_DATA {
15226 fn default() -> Self {
15227 Self::DEFAULT.clone()
15228 }
15229}
15230impl MessageData for HEARTBEAT_DATA {
15231 type Message = MavMessage;
15232 const ID: u32 = 0u32;
15233 const NAME: &'static str = "HEARTBEAT";
15234 const EXTRA_CRC: u8 = 50u8;
15235 const ENCODED_LEN: usize = 9usize;
15236 fn deser(
15237 _version: MavlinkVersion,
15238 __input: &[u8],
15239 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15240 let avail_len = __input.len();
15241 let mut payload_buf = [0; Self::ENCODED_LEN];
15242 let mut buf = if avail_len < Self::ENCODED_LEN {
15243 payload_buf[0..avail_len].copy_from_slice(__input);
15244 Bytes::new(&payload_buf)
15245 } else {
15246 Bytes::new(__input)
15247 };
15248 let mut __struct = Self::default();
15249 __struct.custom_mode = buf.get_u32_le();
15250 let tmp = buf.get_u8();
15251 __struct.mavtype =
15252 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15253 enum_type: "MavType",
15254 value: tmp as u32,
15255 })?;
15256 let tmp = buf.get_u8();
15257 __struct.autopilot =
15258 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15259 enum_type: "MavAutopilot",
15260 value: tmp as u32,
15261 })?;
15262 let tmp = buf.get_u8();
15263 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15264 ::mavlink_core::error::ParserError::InvalidFlag {
15265 flag_type: "MavModeFlag",
15266 value: tmp as u32,
15267 },
15268 )?;
15269 let tmp = buf.get_u8();
15270 __struct.system_status =
15271 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15272 enum_type: "MavState",
15273 value: tmp as u32,
15274 })?;
15275 __struct.mavlink_version = buf.get_u8();
15276 Ok(__struct)
15277 }
15278 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15279 let mut __tmp = BytesMut::new(bytes);
15280 #[allow(clippy::absurd_extreme_comparisons)]
15281 #[allow(unused_comparisons)]
15282 if __tmp.remaining() < Self::ENCODED_LEN {
15283 panic!(
15284 "buffer is too small (need {} bytes, but got {})",
15285 Self::ENCODED_LEN,
15286 __tmp.remaining(),
15287 )
15288 }
15289 __tmp.put_u32_le(self.custom_mode);
15290 __tmp.put_u8(self.mavtype as u8);
15291 __tmp.put_u8(self.autopilot as u8);
15292 __tmp.put_u8(self.base_mode.bits());
15293 __tmp.put_u8(self.system_status as u8);
15294 __tmp.put_u8(self.mavlink_version);
15295 if matches!(version, MavlinkVersion::V2) {
15296 let len = __tmp.len();
15297 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15298 } else {
15299 __tmp.len()
15300 }
15301 }
15302}
15303#[doc = "The IMU readings in SI units in NED body frame."]
15304#[doc = ""]
15305#[doc = "ID: 105"]
15306#[derive(Debug, Clone, PartialEq)]
15307#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15308#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15309pub struct HIGHRES_IMU_DATA {
15310 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15311 pub time_usec: u64,
15312 #[doc = "X acceleration"]
15313 pub xacc: f32,
15314 #[doc = "Y acceleration"]
15315 pub yacc: f32,
15316 #[doc = "Z acceleration"]
15317 pub zacc: f32,
15318 #[doc = "Angular speed around X axis"]
15319 pub xgyro: f32,
15320 #[doc = "Angular speed around Y axis"]
15321 pub ygyro: f32,
15322 #[doc = "Angular speed around Z axis"]
15323 pub zgyro: f32,
15324 #[doc = "X Magnetic field"]
15325 pub xmag: f32,
15326 #[doc = "Y Magnetic field"]
15327 pub ymag: f32,
15328 #[doc = "Z Magnetic field"]
15329 pub zmag: f32,
15330 #[doc = "Absolute pressure"]
15331 pub abs_pressure: f32,
15332 #[doc = "Differential pressure"]
15333 pub diff_pressure: f32,
15334 #[doc = "Altitude calculated from pressure"]
15335 pub pressure_alt: f32,
15336 #[doc = "Temperature"]
15337 pub temperature: f32,
15338 #[doc = "Bitmap for fields that have updated since last message"]
15339 pub fields_updated: HighresImuUpdatedFlags,
15340 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15341 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15342 pub id: u8,
15343}
15344impl HIGHRES_IMU_DATA {
15345 pub const ENCODED_LEN: usize = 63usize;
15346 pub const DEFAULT: Self = Self {
15347 time_usec: 0_u64,
15348 xacc: 0.0_f32,
15349 yacc: 0.0_f32,
15350 zacc: 0.0_f32,
15351 xgyro: 0.0_f32,
15352 ygyro: 0.0_f32,
15353 zgyro: 0.0_f32,
15354 xmag: 0.0_f32,
15355 ymag: 0.0_f32,
15356 zmag: 0.0_f32,
15357 abs_pressure: 0.0_f32,
15358 diff_pressure: 0.0_f32,
15359 pressure_alt: 0.0_f32,
15360 temperature: 0.0_f32,
15361 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15362 id: 0_u8,
15363 };
15364 #[cfg(feature = "arbitrary")]
15365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15366 use arbitrary::{Arbitrary, Unstructured};
15367 let mut buf = [0u8; 1024];
15368 rng.fill_bytes(&mut buf);
15369 let mut unstructured = Unstructured::new(&buf);
15370 Self::arbitrary(&mut unstructured).unwrap_or_default()
15371 }
15372}
15373impl Default for HIGHRES_IMU_DATA {
15374 fn default() -> Self {
15375 Self::DEFAULT.clone()
15376 }
15377}
15378impl MessageData for HIGHRES_IMU_DATA {
15379 type Message = MavMessage;
15380 const ID: u32 = 105u32;
15381 const NAME: &'static str = "HIGHRES_IMU";
15382 const EXTRA_CRC: u8 = 93u8;
15383 const ENCODED_LEN: usize = 63usize;
15384 fn deser(
15385 _version: MavlinkVersion,
15386 __input: &[u8],
15387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15388 let avail_len = __input.len();
15389 let mut payload_buf = [0; Self::ENCODED_LEN];
15390 let mut buf = if avail_len < Self::ENCODED_LEN {
15391 payload_buf[0..avail_len].copy_from_slice(__input);
15392 Bytes::new(&payload_buf)
15393 } else {
15394 Bytes::new(__input)
15395 };
15396 let mut __struct = Self::default();
15397 __struct.time_usec = buf.get_u64_le();
15398 __struct.xacc = buf.get_f32_le();
15399 __struct.yacc = buf.get_f32_le();
15400 __struct.zacc = buf.get_f32_le();
15401 __struct.xgyro = buf.get_f32_le();
15402 __struct.ygyro = buf.get_f32_le();
15403 __struct.zgyro = buf.get_f32_le();
15404 __struct.xmag = buf.get_f32_le();
15405 __struct.ymag = buf.get_f32_le();
15406 __struct.zmag = buf.get_f32_le();
15407 __struct.abs_pressure = buf.get_f32_le();
15408 __struct.diff_pressure = buf.get_f32_le();
15409 __struct.pressure_alt = buf.get_f32_le();
15410 __struct.temperature = buf.get_f32_le();
15411 let tmp = buf.get_u16_le();
15412 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
15413 tmp & HighresImuUpdatedFlags::all().bits(),
15414 )
15415 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15416 flag_type: "HighresImuUpdatedFlags",
15417 value: tmp as u32,
15418 })?;
15419 __struct.id = buf.get_u8();
15420 Ok(__struct)
15421 }
15422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15423 let mut __tmp = BytesMut::new(bytes);
15424 #[allow(clippy::absurd_extreme_comparisons)]
15425 #[allow(unused_comparisons)]
15426 if __tmp.remaining() < Self::ENCODED_LEN {
15427 panic!(
15428 "buffer is too small (need {} bytes, but got {})",
15429 Self::ENCODED_LEN,
15430 __tmp.remaining(),
15431 )
15432 }
15433 __tmp.put_u64_le(self.time_usec);
15434 __tmp.put_f32_le(self.xacc);
15435 __tmp.put_f32_le(self.yacc);
15436 __tmp.put_f32_le(self.zacc);
15437 __tmp.put_f32_le(self.xgyro);
15438 __tmp.put_f32_le(self.ygyro);
15439 __tmp.put_f32_le(self.zgyro);
15440 __tmp.put_f32_le(self.xmag);
15441 __tmp.put_f32_le(self.ymag);
15442 __tmp.put_f32_le(self.zmag);
15443 __tmp.put_f32_le(self.abs_pressure);
15444 __tmp.put_f32_le(self.diff_pressure);
15445 __tmp.put_f32_le(self.pressure_alt);
15446 __tmp.put_f32_le(self.temperature);
15447 __tmp.put_u16_le(self.fields_updated.bits());
15448 if matches!(version, MavlinkVersion::V2) {
15449 __tmp.put_u8(self.id);
15450 let len = __tmp.len();
15451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15452 } else {
15453 __tmp.len()
15454 }
15455 }
15456}
15457#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15458#[doc = "Message appropriate for high latency connections like Iridium."]
15459#[doc = ""]
15460#[doc = "ID: 234"]
15461#[derive(Debug, Clone, PartialEq)]
15462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15463#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15464pub struct HIGH_LATENCY_DATA {
15465 #[doc = "A bitfield for use for autopilot-specific flags."]
15466 pub custom_mode: u32,
15467 #[doc = "Latitude"]
15468 pub latitude: i32,
15469 #[doc = "Longitude"]
15470 pub longitude: i32,
15471 #[doc = "roll"]
15472 pub roll: i16,
15473 #[doc = "pitch"]
15474 pub pitch: i16,
15475 #[doc = "heading"]
15476 pub heading: u16,
15477 #[doc = "heading setpoint"]
15478 pub heading_sp: i16,
15479 #[doc = "Altitude above mean sea level"]
15480 pub altitude_amsl: i16,
15481 #[doc = "Altitude setpoint relative to the home position"]
15482 pub altitude_sp: i16,
15483 #[doc = "distance to target"]
15484 pub wp_distance: u16,
15485 #[doc = "Bitmap of enabled system modes."]
15486 pub base_mode: MavModeFlag,
15487 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15488 pub landed_state: MavLandedState,
15489 #[doc = "throttle (percentage)"]
15490 pub throttle: i8,
15491 #[doc = "airspeed"]
15492 pub airspeed: u8,
15493 #[doc = "airspeed setpoint"]
15494 pub airspeed_sp: u8,
15495 #[doc = "groundspeed"]
15496 pub groundspeed: u8,
15497 #[doc = "climb rate"]
15498 pub climb_rate: i8,
15499 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15500 pub gps_nsat: u8,
15501 #[doc = "GPS Fix type."]
15502 pub gps_fix_type: GpsFixType,
15503 #[doc = "Remaining battery (percentage)"]
15504 pub battery_remaining: u8,
15505 #[doc = "Autopilot temperature (degrees C)"]
15506 pub temperature: i8,
15507 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15508 pub temperature_air: i8,
15509 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15510 pub failsafe: u8,
15511 #[doc = "current waypoint number"]
15512 pub wp_num: u8,
15513}
15514impl HIGH_LATENCY_DATA {
15515 pub const ENCODED_LEN: usize = 40usize;
15516 pub const DEFAULT: Self = Self {
15517 custom_mode: 0_u32,
15518 latitude: 0_i32,
15519 longitude: 0_i32,
15520 roll: 0_i16,
15521 pitch: 0_i16,
15522 heading: 0_u16,
15523 heading_sp: 0_i16,
15524 altitude_amsl: 0_i16,
15525 altitude_sp: 0_i16,
15526 wp_distance: 0_u16,
15527 base_mode: MavModeFlag::DEFAULT,
15528 landed_state: MavLandedState::DEFAULT,
15529 throttle: 0_i8,
15530 airspeed: 0_u8,
15531 airspeed_sp: 0_u8,
15532 groundspeed: 0_u8,
15533 climb_rate: 0_i8,
15534 gps_nsat: 0_u8,
15535 gps_fix_type: GpsFixType::DEFAULT,
15536 battery_remaining: 0_u8,
15537 temperature: 0_i8,
15538 temperature_air: 0_i8,
15539 failsafe: 0_u8,
15540 wp_num: 0_u8,
15541 };
15542 #[cfg(feature = "arbitrary")]
15543 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15544 use arbitrary::{Arbitrary, Unstructured};
15545 let mut buf = [0u8; 1024];
15546 rng.fill_bytes(&mut buf);
15547 let mut unstructured = Unstructured::new(&buf);
15548 Self::arbitrary(&mut unstructured).unwrap_or_default()
15549 }
15550}
15551impl Default for HIGH_LATENCY_DATA {
15552 fn default() -> Self {
15553 Self::DEFAULT.clone()
15554 }
15555}
15556impl MessageData for HIGH_LATENCY_DATA {
15557 type Message = MavMessage;
15558 const ID: u32 = 234u32;
15559 const NAME: &'static str = "HIGH_LATENCY";
15560 const EXTRA_CRC: u8 = 150u8;
15561 const ENCODED_LEN: usize = 40usize;
15562 fn deser(
15563 _version: MavlinkVersion,
15564 __input: &[u8],
15565 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15566 let avail_len = __input.len();
15567 let mut payload_buf = [0; Self::ENCODED_LEN];
15568 let mut buf = if avail_len < Self::ENCODED_LEN {
15569 payload_buf[0..avail_len].copy_from_slice(__input);
15570 Bytes::new(&payload_buf)
15571 } else {
15572 Bytes::new(__input)
15573 };
15574 let mut __struct = Self::default();
15575 __struct.custom_mode = buf.get_u32_le();
15576 __struct.latitude = buf.get_i32_le();
15577 __struct.longitude = buf.get_i32_le();
15578 __struct.roll = buf.get_i16_le();
15579 __struct.pitch = buf.get_i16_le();
15580 __struct.heading = buf.get_u16_le();
15581 __struct.heading_sp = buf.get_i16_le();
15582 __struct.altitude_amsl = buf.get_i16_le();
15583 __struct.altitude_sp = buf.get_i16_le();
15584 __struct.wp_distance = buf.get_u16_le();
15585 let tmp = buf.get_u8();
15586 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15587 ::mavlink_core::error::ParserError::InvalidFlag {
15588 flag_type: "MavModeFlag",
15589 value: tmp as u32,
15590 },
15591 )?;
15592 let tmp = buf.get_u8();
15593 __struct.landed_state =
15594 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15595 enum_type: "MavLandedState",
15596 value: tmp as u32,
15597 })?;
15598 __struct.throttle = buf.get_i8();
15599 __struct.airspeed = buf.get_u8();
15600 __struct.airspeed_sp = buf.get_u8();
15601 __struct.groundspeed = buf.get_u8();
15602 __struct.climb_rate = buf.get_i8();
15603 __struct.gps_nsat = buf.get_u8();
15604 let tmp = buf.get_u8();
15605 __struct.gps_fix_type =
15606 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15607 enum_type: "GpsFixType",
15608 value: tmp as u32,
15609 })?;
15610 __struct.battery_remaining = buf.get_u8();
15611 __struct.temperature = buf.get_i8();
15612 __struct.temperature_air = buf.get_i8();
15613 __struct.failsafe = buf.get_u8();
15614 __struct.wp_num = buf.get_u8();
15615 Ok(__struct)
15616 }
15617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15618 let mut __tmp = BytesMut::new(bytes);
15619 #[allow(clippy::absurd_extreme_comparisons)]
15620 #[allow(unused_comparisons)]
15621 if __tmp.remaining() < Self::ENCODED_LEN {
15622 panic!(
15623 "buffer is too small (need {} bytes, but got {})",
15624 Self::ENCODED_LEN,
15625 __tmp.remaining(),
15626 )
15627 }
15628 __tmp.put_u32_le(self.custom_mode);
15629 __tmp.put_i32_le(self.latitude);
15630 __tmp.put_i32_le(self.longitude);
15631 __tmp.put_i16_le(self.roll);
15632 __tmp.put_i16_le(self.pitch);
15633 __tmp.put_u16_le(self.heading);
15634 __tmp.put_i16_le(self.heading_sp);
15635 __tmp.put_i16_le(self.altitude_amsl);
15636 __tmp.put_i16_le(self.altitude_sp);
15637 __tmp.put_u16_le(self.wp_distance);
15638 __tmp.put_u8(self.base_mode.bits());
15639 __tmp.put_u8(self.landed_state as u8);
15640 __tmp.put_i8(self.throttle);
15641 __tmp.put_u8(self.airspeed);
15642 __tmp.put_u8(self.airspeed_sp);
15643 __tmp.put_u8(self.groundspeed);
15644 __tmp.put_i8(self.climb_rate);
15645 __tmp.put_u8(self.gps_nsat);
15646 __tmp.put_u8(self.gps_fix_type as u8);
15647 __tmp.put_u8(self.battery_remaining);
15648 __tmp.put_i8(self.temperature);
15649 __tmp.put_i8(self.temperature_air);
15650 __tmp.put_u8(self.failsafe);
15651 __tmp.put_u8(self.wp_num);
15652 if matches!(version, MavlinkVersion::V2) {
15653 let len = __tmp.len();
15654 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15655 } else {
15656 __tmp.len()
15657 }
15658 }
15659}
15660#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15661#[doc = ""]
15662#[doc = "ID: 235"]
15663#[derive(Debug, Clone, PartialEq)]
15664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15666pub struct HIGH_LATENCY2_DATA {
15667 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15668 pub timestamp: u32,
15669 #[doc = "Latitude"]
15670 pub latitude: i32,
15671 #[doc = "Longitude"]
15672 pub longitude: i32,
15673 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15674 pub custom_mode: u16,
15675 #[doc = "Altitude above mean sea level"]
15676 pub altitude: i16,
15677 #[doc = "Altitude setpoint"]
15678 pub target_altitude: i16,
15679 #[doc = "Distance to target waypoint or position"]
15680 pub target_distance: u16,
15681 #[doc = "Current waypoint number"]
15682 pub wp_num: u16,
15683 #[doc = "Bitmap of failure flags."]
15684 pub failure_flags: HlFailureFlag,
15685 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15686 pub mavtype: MavType,
15687 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15688 pub autopilot: MavAutopilot,
15689 #[doc = "Heading"]
15690 pub heading: u8,
15691 #[doc = "Heading setpoint"]
15692 pub target_heading: u8,
15693 #[doc = "Throttle"]
15694 pub throttle: u8,
15695 #[doc = "Airspeed"]
15696 pub airspeed: u8,
15697 #[doc = "Airspeed setpoint"]
15698 pub airspeed_sp: u8,
15699 #[doc = "Groundspeed"]
15700 pub groundspeed: u8,
15701 #[doc = "Windspeed"]
15702 pub windspeed: u8,
15703 #[doc = "Wind heading"]
15704 pub wind_heading: u8,
15705 #[doc = "Maximum error horizontal position since last message"]
15706 pub eph: u8,
15707 #[doc = "Maximum error vertical position since last message"]
15708 pub epv: u8,
15709 #[doc = "Air temperature"]
15710 pub temperature_air: i8,
15711 #[doc = "Maximum climb rate magnitude since last message"]
15712 pub climb_rate: i8,
15713 #[doc = "Battery level (-1 if field not provided)."]
15714 pub battery: i8,
15715 #[doc = "Field for custom payload."]
15716 pub custom0: i8,
15717 #[doc = "Field for custom payload."]
15718 pub custom1: i8,
15719 #[doc = "Field for custom payload."]
15720 pub custom2: i8,
15721}
15722impl HIGH_LATENCY2_DATA {
15723 pub const ENCODED_LEN: usize = 42usize;
15724 pub const DEFAULT: Self = Self {
15725 timestamp: 0_u32,
15726 latitude: 0_i32,
15727 longitude: 0_i32,
15728 custom_mode: 0_u16,
15729 altitude: 0_i16,
15730 target_altitude: 0_i16,
15731 target_distance: 0_u16,
15732 wp_num: 0_u16,
15733 failure_flags: HlFailureFlag::DEFAULT,
15734 mavtype: MavType::DEFAULT,
15735 autopilot: MavAutopilot::DEFAULT,
15736 heading: 0_u8,
15737 target_heading: 0_u8,
15738 throttle: 0_u8,
15739 airspeed: 0_u8,
15740 airspeed_sp: 0_u8,
15741 groundspeed: 0_u8,
15742 windspeed: 0_u8,
15743 wind_heading: 0_u8,
15744 eph: 0_u8,
15745 epv: 0_u8,
15746 temperature_air: 0_i8,
15747 climb_rate: 0_i8,
15748 battery: 0_i8,
15749 custom0: 0_i8,
15750 custom1: 0_i8,
15751 custom2: 0_i8,
15752 };
15753 #[cfg(feature = "arbitrary")]
15754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15755 use arbitrary::{Arbitrary, Unstructured};
15756 let mut buf = [0u8; 1024];
15757 rng.fill_bytes(&mut buf);
15758 let mut unstructured = Unstructured::new(&buf);
15759 Self::arbitrary(&mut unstructured).unwrap_or_default()
15760 }
15761}
15762impl Default for HIGH_LATENCY2_DATA {
15763 fn default() -> Self {
15764 Self::DEFAULT.clone()
15765 }
15766}
15767impl MessageData for HIGH_LATENCY2_DATA {
15768 type Message = MavMessage;
15769 const ID: u32 = 235u32;
15770 const NAME: &'static str = "HIGH_LATENCY2";
15771 const EXTRA_CRC: u8 = 179u8;
15772 const ENCODED_LEN: usize = 42usize;
15773 fn deser(
15774 _version: MavlinkVersion,
15775 __input: &[u8],
15776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15777 let avail_len = __input.len();
15778 let mut payload_buf = [0; Self::ENCODED_LEN];
15779 let mut buf = if avail_len < Self::ENCODED_LEN {
15780 payload_buf[0..avail_len].copy_from_slice(__input);
15781 Bytes::new(&payload_buf)
15782 } else {
15783 Bytes::new(__input)
15784 };
15785 let mut __struct = Self::default();
15786 __struct.timestamp = buf.get_u32_le();
15787 __struct.latitude = buf.get_i32_le();
15788 __struct.longitude = buf.get_i32_le();
15789 __struct.custom_mode = buf.get_u16_le();
15790 __struct.altitude = buf.get_i16_le();
15791 __struct.target_altitude = buf.get_i16_le();
15792 __struct.target_distance = buf.get_u16_le();
15793 __struct.wp_num = buf.get_u16_le();
15794 let tmp = buf.get_u16_le();
15795 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15796 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15797 flag_type: "HlFailureFlag",
15798 value: tmp as u32,
15799 })?;
15800 let tmp = buf.get_u8();
15801 __struct.mavtype =
15802 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15803 enum_type: "MavType",
15804 value: tmp as u32,
15805 })?;
15806 let tmp = buf.get_u8();
15807 __struct.autopilot =
15808 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15809 enum_type: "MavAutopilot",
15810 value: tmp as u32,
15811 })?;
15812 __struct.heading = buf.get_u8();
15813 __struct.target_heading = buf.get_u8();
15814 __struct.throttle = buf.get_u8();
15815 __struct.airspeed = buf.get_u8();
15816 __struct.airspeed_sp = buf.get_u8();
15817 __struct.groundspeed = buf.get_u8();
15818 __struct.windspeed = buf.get_u8();
15819 __struct.wind_heading = buf.get_u8();
15820 __struct.eph = buf.get_u8();
15821 __struct.epv = buf.get_u8();
15822 __struct.temperature_air = buf.get_i8();
15823 __struct.climb_rate = buf.get_i8();
15824 __struct.battery = buf.get_i8();
15825 __struct.custom0 = buf.get_i8();
15826 __struct.custom1 = buf.get_i8();
15827 __struct.custom2 = buf.get_i8();
15828 Ok(__struct)
15829 }
15830 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15831 let mut __tmp = BytesMut::new(bytes);
15832 #[allow(clippy::absurd_extreme_comparisons)]
15833 #[allow(unused_comparisons)]
15834 if __tmp.remaining() < Self::ENCODED_LEN {
15835 panic!(
15836 "buffer is too small (need {} bytes, but got {})",
15837 Self::ENCODED_LEN,
15838 __tmp.remaining(),
15839 )
15840 }
15841 __tmp.put_u32_le(self.timestamp);
15842 __tmp.put_i32_le(self.latitude);
15843 __tmp.put_i32_le(self.longitude);
15844 __tmp.put_u16_le(self.custom_mode);
15845 __tmp.put_i16_le(self.altitude);
15846 __tmp.put_i16_le(self.target_altitude);
15847 __tmp.put_u16_le(self.target_distance);
15848 __tmp.put_u16_le(self.wp_num);
15849 __tmp.put_u16_le(self.failure_flags.bits());
15850 __tmp.put_u8(self.mavtype as u8);
15851 __tmp.put_u8(self.autopilot as u8);
15852 __tmp.put_u8(self.heading);
15853 __tmp.put_u8(self.target_heading);
15854 __tmp.put_u8(self.throttle);
15855 __tmp.put_u8(self.airspeed);
15856 __tmp.put_u8(self.airspeed_sp);
15857 __tmp.put_u8(self.groundspeed);
15858 __tmp.put_u8(self.windspeed);
15859 __tmp.put_u8(self.wind_heading);
15860 __tmp.put_u8(self.eph);
15861 __tmp.put_u8(self.epv);
15862 __tmp.put_i8(self.temperature_air);
15863 __tmp.put_i8(self.climb_rate);
15864 __tmp.put_i8(self.battery);
15865 __tmp.put_i8(self.custom0);
15866 __tmp.put_i8(self.custom1);
15867 __tmp.put_i8(self.custom2);
15868 if matches!(version, MavlinkVersion::V2) {
15869 let len = __tmp.len();
15870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15871 } else {
15872 __tmp.len()
15873 }
15874 }
15875}
15876#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15877#[doc = ""]
15878#[doc = "ID: 93"]
15879#[derive(Debug, Clone, PartialEq)]
15880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15882pub struct HIL_ACTUATOR_CONTROLS_DATA {
15883 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15884 pub time_usec: u64,
15885 #[doc = "Flags bitmask."]
15886 pub flags: HilActuatorControlsFlags,
15887 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15888 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15889 pub controls: [f32; 16],
15890 #[doc = "System mode. Includes arming state."]
15891 pub mode: MavModeFlag,
15892}
15893impl HIL_ACTUATOR_CONTROLS_DATA {
15894 pub const ENCODED_LEN: usize = 81usize;
15895 pub const DEFAULT: Self = Self {
15896 time_usec: 0_u64,
15897 flags: HilActuatorControlsFlags::DEFAULT,
15898 controls: [0.0_f32; 16usize],
15899 mode: MavModeFlag::DEFAULT,
15900 };
15901 #[cfg(feature = "arbitrary")]
15902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15903 use arbitrary::{Arbitrary, Unstructured};
15904 let mut buf = [0u8; 1024];
15905 rng.fill_bytes(&mut buf);
15906 let mut unstructured = Unstructured::new(&buf);
15907 Self::arbitrary(&mut unstructured).unwrap_or_default()
15908 }
15909}
15910impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15911 fn default() -> Self {
15912 Self::DEFAULT.clone()
15913 }
15914}
15915impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15916 type Message = MavMessage;
15917 const ID: u32 = 93u32;
15918 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15919 const EXTRA_CRC: u8 = 47u8;
15920 const ENCODED_LEN: usize = 81usize;
15921 fn deser(
15922 _version: MavlinkVersion,
15923 __input: &[u8],
15924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15925 let avail_len = __input.len();
15926 let mut payload_buf = [0; Self::ENCODED_LEN];
15927 let mut buf = if avail_len < Self::ENCODED_LEN {
15928 payload_buf[0..avail_len].copy_from_slice(__input);
15929 Bytes::new(&payload_buf)
15930 } else {
15931 Bytes::new(__input)
15932 };
15933 let mut __struct = Self::default();
15934 __struct.time_usec = buf.get_u64_le();
15935 let tmp = buf.get_u64_le();
15936 __struct.flags =
15937 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15938 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15939 flag_type: "HilActuatorControlsFlags",
15940 value: tmp as u32,
15941 })?;
15942 for v in &mut __struct.controls {
15943 let val = buf.get_f32_le();
15944 *v = val;
15945 }
15946 let tmp = buf.get_u8();
15947 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15948 ::mavlink_core::error::ParserError::InvalidFlag {
15949 flag_type: "MavModeFlag",
15950 value: tmp as u32,
15951 },
15952 )?;
15953 Ok(__struct)
15954 }
15955 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15956 let mut __tmp = BytesMut::new(bytes);
15957 #[allow(clippy::absurd_extreme_comparisons)]
15958 #[allow(unused_comparisons)]
15959 if __tmp.remaining() < Self::ENCODED_LEN {
15960 panic!(
15961 "buffer is too small (need {} bytes, but got {})",
15962 Self::ENCODED_LEN,
15963 __tmp.remaining(),
15964 )
15965 }
15966 __tmp.put_u64_le(self.time_usec);
15967 __tmp.put_u64_le(self.flags.bits());
15968 for val in &self.controls {
15969 __tmp.put_f32_le(*val);
15970 }
15971 __tmp.put_u8(self.mode.bits());
15972 if matches!(version, MavlinkVersion::V2) {
15973 let len = __tmp.len();
15974 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15975 } else {
15976 __tmp.len()
15977 }
15978 }
15979}
15980#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15981#[doc = ""]
15982#[doc = "ID: 91"]
15983#[derive(Debug, Clone, PartialEq)]
15984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15986pub struct HIL_CONTROLS_DATA {
15987 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15988 pub time_usec: u64,
15989 #[doc = "Control output -1 .. 1"]
15990 pub roll_ailerons: f32,
15991 #[doc = "Control output -1 .. 1"]
15992 pub pitch_elevator: f32,
15993 #[doc = "Control output -1 .. 1"]
15994 pub yaw_rudder: f32,
15995 #[doc = "Throttle 0 .. 1"]
15996 pub throttle: f32,
15997 #[doc = "Aux 1, -1 .. 1"]
15998 pub aux1: f32,
15999 #[doc = "Aux 2, -1 .. 1"]
16000 pub aux2: f32,
16001 #[doc = "Aux 3, -1 .. 1"]
16002 pub aux3: f32,
16003 #[doc = "Aux 4, -1 .. 1"]
16004 pub aux4: f32,
16005 #[doc = "System mode."]
16006 pub mode: MavMode,
16007 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16008 pub nav_mode: u8,
16009}
16010impl HIL_CONTROLS_DATA {
16011 pub const ENCODED_LEN: usize = 42usize;
16012 pub const DEFAULT: Self = Self {
16013 time_usec: 0_u64,
16014 roll_ailerons: 0.0_f32,
16015 pitch_elevator: 0.0_f32,
16016 yaw_rudder: 0.0_f32,
16017 throttle: 0.0_f32,
16018 aux1: 0.0_f32,
16019 aux2: 0.0_f32,
16020 aux3: 0.0_f32,
16021 aux4: 0.0_f32,
16022 mode: MavMode::DEFAULT,
16023 nav_mode: 0_u8,
16024 };
16025 #[cfg(feature = "arbitrary")]
16026 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16027 use arbitrary::{Arbitrary, Unstructured};
16028 let mut buf = [0u8; 1024];
16029 rng.fill_bytes(&mut buf);
16030 let mut unstructured = Unstructured::new(&buf);
16031 Self::arbitrary(&mut unstructured).unwrap_or_default()
16032 }
16033}
16034impl Default for HIL_CONTROLS_DATA {
16035 fn default() -> Self {
16036 Self::DEFAULT.clone()
16037 }
16038}
16039impl MessageData for HIL_CONTROLS_DATA {
16040 type Message = MavMessage;
16041 const ID: u32 = 91u32;
16042 const NAME: &'static str = "HIL_CONTROLS";
16043 const EXTRA_CRC: u8 = 63u8;
16044 const ENCODED_LEN: usize = 42usize;
16045 fn deser(
16046 _version: MavlinkVersion,
16047 __input: &[u8],
16048 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16049 let avail_len = __input.len();
16050 let mut payload_buf = [0; Self::ENCODED_LEN];
16051 let mut buf = if avail_len < Self::ENCODED_LEN {
16052 payload_buf[0..avail_len].copy_from_slice(__input);
16053 Bytes::new(&payload_buf)
16054 } else {
16055 Bytes::new(__input)
16056 };
16057 let mut __struct = Self::default();
16058 __struct.time_usec = buf.get_u64_le();
16059 __struct.roll_ailerons = buf.get_f32_le();
16060 __struct.pitch_elevator = buf.get_f32_le();
16061 __struct.yaw_rudder = buf.get_f32_le();
16062 __struct.throttle = buf.get_f32_le();
16063 __struct.aux1 = buf.get_f32_le();
16064 __struct.aux2 = buf.get_f32_le();
16065 __struct.aux3 = buf.get_f32_le();
16066 __struct.aux4 = buf.get_f32_le();
16067 let tmp = buf.get_u8();
16068 __struct.mode =
16069 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16070 enum_type: "MavMode",
16071 value: tmp as u32,
16072 })?;
16073 __struct.nav_mode = buf.get_u8();
16074 Ok(__struct)
16075 }
16076 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16077 let mut __tmp = BytesMut::new(bytes);
16078 #[allow(clippy::absurd_extreme_comparisons)]
16079 #[allow(unused_comparisons)]
16080 if __tmp.remaining() < Self::ENCODED_LEN {
16081 panic!(
16082 "buffer is too small (need {} bytes, but got {})",
16083 Self::ENCODED_LEN,
16084 __tmp.remaining(),
16085 )
16086 }
16087 __tmp.put_u64_le(self.time_usec);
16088 __tmp.put_f32_le(self.roll_ailerons);
16089 __tmp.put_f32_le(self.pitch_elevator);
16090 __tmp.put_f32_le(self.yaw_rudder);
16091 __tmp.put_f32_le(self.throttle);
16092 __tmp.put_f32_le(self.aux1);
16093 __tmp.put_f32_le(self.aux2);
16094 __tmp.put_f32_le(self.aux3);
16095 __tmp.put_f32_le(self.aux4);
16096 __tmp.put_u8(self.mode as u8);
16097 __tmp.put_u8(self.nav_mode);
16098 if matches!(version, MavlinkVersion::V2) {
16099 let len = __tmp.len();
16100 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16101 } else {
16102 __tmp.len()
16103 }
16104 }
16105}
16106#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16107#[doc = ""]
16108#[doc = "ID: 113"]
16109#[derive(Debug, Clone, PartialEq)]
16110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16111#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16112pub struct HIL_GPS_DATA {
16113 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16114 pub time_usec: u64,
16115 #[doc = "Latitude (WGS84)"]
16116 pub lat: i32,
16117 #[doc = "Longitude (WGS84)"]
16118 pub lon: i32,
16119 #[doc = "Altitude (MSL). Positive for up."]
16120 pub alt: i32,
16121 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16122 pub eph: u16,
16123 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16124 pub epv: u16,
16125 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16126 pub vel: u16,
16127 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16128 pub vn: i16,
16129 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16130 pub ve: i16,
16131 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16132 pub vd: i16,
16133 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16134 pub cog: u16,
16135 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16136 pub fix_type: u8,
16137 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16138 pub satellites_visible: u8,
16139 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16140 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16141 pub id: u8,
16142 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16143 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16144 pub yaw: u16,
16145}
16146impl HIL_GPS_DATA {
16147 pub const ENCODED_LEN: usize = 39usize;
16148 pub const DEFAULT: Self = Self {
16149 time_usec: 0_u64,
16150 lat: 0_i32,
16151 lon: 0_i32,
16152 alt: 0_i32,
16153 eph: 0_u16,
16154 epv: 0_u16,
16155 vel: 0_u16,
16156 vn: 0_i16,
16157 ve: 0_i16,
16158 vd: 0_i16,
16159 cog: 0_u16,
16160 fix_type: 0_u8,
16161 satellites_visible: 0_u8,
16162 id: 0_u8,
16163 yaw: 0_u16,
16164 };
16165 #[cfg(feature = "arbitrary")]
16166 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16167 use arbitrary::{Arbitrary, Unstructured};
16168 let mut buf = [0u8; 1024];
16169 rng.fill_bytes(&mut buf);
16170 let mut unstructured = Unstructured::new(&buf);
16171 Self::arbitrary(&mut unstructured).unwrap_or_default()
16172 }
16173}
16174impl Default for HIL_GPS_DATA {
16175 fn default() -> Self {
16176 Self::DEFAULT.clone()
16177 }
16178}
16179impl MessageData for HIL_GPS_DATA {
16180 type Message = MavMessage;
16181 const ID: u32 = 113u32;
16182 const NAME: &'static str = "HIL_GPS";
16183 const EXTRA_CRC: u8 = 124u8;
16184 const ENCODED_LEN: usize = 39usize;
16185 fn deser(
16186 _version: MavlinkVersion,
16187 __input: &[u8],
16188 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16189 let avail_len = __input.len();
16190 let mut payload_buf = [0; Self::ENCODED_LEN];
16191 let mut buf = if avail_len < Self::ENCODED_LEN {
16192 payload_buf[0..avail_len].copy_from_slice(__input);
16193 Bytes::new(&payload_buf)
16194 } else {
16195 Bytes::new(__input)
16196 };
16197 let mut __struct = Self::default();
16198 __struct.time_usec = buf.get_u64_le();
16199 __struct.lat = buf.get_i32_le();
16200 __struct.lon = buf.get_i32_le();
16201 __struct.alt = buf.get_i32_le();
16202 __struct.eph = buf.get_u16_le();
16203 __struct.epv = buf.get_u16_le();
16204 __struct.vel = buf.get_u16_le();
16205 __struct.vn = buf.get_i16_le();
16206 __struct.ve = buf.get_i16_le();
16207 __struct.vd = buf.get_i16_le();
16208 __struct.cog = buf.get_u16_le();
16209 __struct.fix_type = buf.get_u8();
16210 __struct.satellites_visible = buf.get_u8();
16211 __struct.id = buf.get_u8();
16212 __struct.yaw = buf.get_u16_le();
16213 Ok(__struct)
16214 }
16215 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16216 let mut __tmp = BytesMut::new(bytes);
16217 #[allow(clippy::absurd_extreme_comparisons)]
16218 #[allow(unused_comparisons)]
16219 if __tmp.remaining() < Self::ENCODED_LEN {
16220 panic!(
16221 "buffer is too small (need {} bytes, but got {})",
16222 Self::ENCODED_LEN,
16223 __tmp.remaining(),
16224 )
16225 }
16226 __tmp.put_u64_le(self.time_usec);
16227 __tmp.put_i32_le(self.lat);
16228 __tmp.put_i32_le(self.lon);
16229 __tmp.put_i32_le(self.alt);
16230 __tmp.put_u16_le(self.eph);
16231 __tmp.put_u16_le(self.epv);
16232 __tmp.put_u16_le(self.vel);
16233 __tmp.put_i16_le(self.vn);
16234 __tmp.put_i16_le(self.ve);
16235 __tmp.put_i16_le(self.vd);
16236 __tmp.put_u16_le(self.cog);
16237 __tmp.put_u8(self.fix_type);
16238 __tmp.put_u8(self.satellites_visible);
16239 if matches!(version, MavlinkVersion::V2) {
16240 __tmp.put_u8(self.id);
16241 __tmp.put_u16_le(self.yaw);
16242 let len = __tmp.len();
16243 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16244 } else {
16245 __tmp.len()
16246 }
16247 }
16248}
16249#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16250#[doc = ""]
16251#[doc = "ID: 114"]
16252#[derive(Debug, Clone, PartialEq)]
16253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16255pub struct HIL_OPTICAL_FLOW_DATA {
16256 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16257 pub time_usec: u64,
16258 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16259 pub integration_time_us: u32,
16260 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16261 pub integrated_x: f32,
16262 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16263 pub integrated_y: f32,
16264 #[doc = "RH rotation around X axis"]
16265 pub integrated_xgyro: f32,
16266 #[doc = "RH rotation around Y axis"]
16267 pub integrated_ygyro: f32,
16268 #[doc = "RH rotation around Z axis"]
16269 pub integrated_zgyro: f32,
16270 #[doc = "Time since the distance was sampled."]
16271 pub time_delta_distance_us: u32,
16272 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16273 pub distance: f32,
16274 #[doc = "Temperature"]
16275 pub temperature: i16,
16276 #[doc = "Sensor ID"]
16277 pub sensor_id: u8,
16278 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16279 pub quality: u8,
16280}
16281impl HIL_OPTICAL_FLOW_DATA {
16282 pub const ENCODED_LEN: usize = 44usize;
16283 pub const DEFAULT: Self = Self {
16284 time_usec: 0_u64,
16285 integration_time_us: 0_u32,
16286 integrated_x: 0.0_f32,
16287 integrated_y: 0.0_f32,
16288 integrated_xgyro: 0.0_f32,
16289 integrated_ygyro: 0.0_f32,
16290 integrated_zgyro: 0.0_f32,
16291 time_delta_distance_us: 0_u32,
16292 distance: 0.0_f32,
16293 temperature: 0_i16,
16294 sensor_id: 0_u8,
16295 quality: 0_u8,
16296 };
16297 #[cfg(feature = "arbitrary")]
16298 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16299 use arbitrary::{Arbitrary, Unstructured};
16300 let mut buf = [0u8; 1024];
16301 rng.fill_bytes(&mut buf);
16302 let mut unstructured = Unstructured::new(&buf);
16303 Self::arbitrary(&mut unstructured).unwrap_or_default()
16304 }
16305}
16306impl Default for HIL_OPTICAL_FLOW_DATA {
16307 fn default() -> Self {
16308 Self::DEFAULT.clone()
16309 }
16310}
16311impl MessageData for HIL_OPTICAL_FLOW_DATA {
16312 type Message = MavMessage;
16313 const ID: u32 = 114u32;
16314 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16315 const EXTRA_CRC: u8 = 237u8;
16316 const ENCODED_LEN: usize = 44usize;
16317 fn deser(
16318 _version: MavlinkVersion,
16319 __input: &[u8],
16320 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16321 let avail_len = __input.len();
16322 let mut payload_buf = [0; Self::ENCODED_LEN];
16323 let mut buf = if avail_len < Self::ENCODED_LEN {
16324 payload_buf[0..avail_len].copy_from_slice(__input);
16325 Bytes::new(&payload_buf)
16326 } else {
16327 Bytes::new(__input)
16328 };
16329 let mut __struct = Self::default();
16330 __struct.time_usec = buf.get_u64_le();
16331 __struct.integration_time_us = buf.get_u32_le();
16332 __struct.integrated_x = buf.get_f32_le();
16333 __struct.integrated_y = buf.get_f32_le();
16334 __struct.integrated_xgyro = buf.get_f32_le();
16335 __struct.integrated_ygyro = buf.get_f32_le();
16336 __struct.integrated_zgyro = buf.get_f32_le();
16337 __struct.time_delta_distance_us = buf.get_u32_le();
16338 __struct.distance = buf.get_f32_le();
16339 __struct.temperature = buf.get_i16_le();
16340 __struct.sensor_id = buf.get_u8();
16341 __struct.quality = buf.get_u8();
16342 Ok(__struct)
16343 }
16344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16345 let mut __tmp = BytesMut::new(bytes);
16346 #[allow(clippy::absurd_extreme_comparisons)]
16347 #[allow(unused_comparisons)]
16348 if __tmp.remaining() < Self::ENCODED_LEN {
16349 panic!(
16350 "buffer is too small (need {} bytes, but got {})",
16351 Self::ENCODED_LEN,
16352 __tmp.remaining(),
16353 )
16354 }
16355 __tmp.put_u64_le(self.time_usec);
16356 __tmp.put_u32_le(self.integration_time_us);
16357 __tmp.put_f32_le(self.integrated_x);
16358 __tmp.put_f32_le(self.integrated_y);
16359 __tmp.put_f32_le(self.integrated_xgyro);
16360 __tmp.put_f32_le(self.integrated_ygyro);
16361 __tmp.put_f32_le(self.integrated_zgyro);
16362 __tmp.put_u32_le(self.time_delta_distance_us);
16363 __tmp.put_f32_le(self.distance);
16364 __tmp.put_i16_le(self.temperature);
16365 __tmp.put_u8(self.sensor_id);
16366 __tmp.put_u8(self.quality);
16367 if matches!(version, MavlinkVersion::V2) {
16368 let len = __tmp.len();
16369 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16370 } else {
16371 __tmp.len()
16372 }
16373 }
16374}
16375#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16376#[doc = ""]
16377#[doc = "ID: 92"]
16378#[derive(Debug, Clone, PartialEq)]
16379#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16381pub struct HIL_RC_INPUTS_RAW_DATA {
16382 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16383 pub time_usec: u64,
16384 #[doc = "RC channel 1 value"]
16385 pub chan1_raw: u16,
16386 #[doc = "RC channel 2 value"]
16387 pub chan2_raw: u16,
16388 #[doc = "RC channel 3 value"]
16389 pub chan3_raw: u16,
16390 #[doc = "RC channel 4 value"]
16391 pub chan4_raw: u16,
16392 #[doc = "RC channel 5 value"]
16393 pub chan5_raw: u16,
16394 #[doc = "RC channel 6 value"]
16395 pub chan6_raw: u16,
16396 #[doc = "RC channel 7 value"]
16397 pub chan7_raw: u16,
16398 #[doc = "RC channel 8 value"]
16399 pub chan8_raw: u16,
16400 #[doc = "RC channel 9 value"]
16401 pub chan9_raw: u16,
16402 #[doc = "RC channel 10 value"]
16403 pub chan10_raw: u16,
16404 #[doc = "RC channel 11 value"]
16405 pub chan11_raw: u16,
16406 #[doc = "RC channel 12 value"]
16407 pub chan12_raw: u16,
16408 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16409 pub rssi: u8,
16410}
16411impl HIL_RC_INPUTS_RAW_DATA {
16412 pub const ENCODED_LEN: usize = 33usize;
16413 pub const DEFAULT: Self = Self {
16414 time_usec: 0_u64,
16415 chan1_raw: 0_u16,
16416 chan2_raw: 0_u16,
16417 chan3_raw: 0_u16,
16418 chan4_raw: 0_u16,
16419 chan5_raw: 0_u16,
16420 chan6_raw: 0_u16,
16421 chan7_raw: 0_u16,
16422 chan8_raw: 0_u16,
16423 chan9_raw: 0_u16,
16424 chan10_raw: 0_u16,
16425 chan11_raw: 0_u16,
16426 chan12_raw: 0_u16,
16427 rssi: 0_u8,
16428 };
16429 #[cfg(feature = "arbitrary")]
16430 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16431 use arbitrary::{Arbitrary, Unstructured};
16432 let mut buf = [0u8; 1024];
16433 rng.fill_bytes(&mut buf);
16434 let mut unstructured = Unstructured::new(&buf);
16435 Self::arbitrary(&mut unstructured).unwrap_or_default()
16436 }
16437}
16438impl Default for HIL_RC_INPUTS_RAW_DATA {
16439 fn default() -> Self {
16440 Self::DEFAULT.clone()
16441 }
16442}
16443impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16444 type Message = MavMessage;
16445 const ID: u32 = 92u32;
16446 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16447 const EXTRA_CRC: u8 = 54u8;
16448 const ENCODED_LEN: usize = 33usize;
16449 fn deser(
16450 _version: MavlinkVersion,
16451 __input: &[u8],
16452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16453 let avail_len = __input.len();
16454 let mut payload_buf = [0; Self::ENCODED_LEN];
16455 let mut buf = if avail_len < Self::ENCODED_LEN {
16456 payload_buf[0..avail_len].copy_from_slice(__input);
16457 Bytes::new(&payload_buf)
16458 } else {
16459 Bytes::new(__input)
16460 };
16461 let mut __struct = Self::default();
16462 __struct.time_usec = buf.get_u64_le();
16463 __struct.chan1_raw = buf.get_u16_le();
16464 __struct.chan2_raw = buf.get_u16_le();
16465 __struct.chan3_raw = buf.get_u16_le();
16466 __struct.chan4_raw = buf.get_u16_le();
16467 __struct.chan5_raw = buf.get_u16_le();
16468 __struct.chan6_raw = buf.get_u16_le();
16469 __struct.chan7_raw = buf.get_u16_le();
16470 __struct.chan8_raw = buf.get_u16_le();
16471 __struct.chan9_raw = buf.get_u16_le();
16472 __struct.chan10_raw = buf.get_u16_le();
16473 __struct.chan11_raw = buf.get_u16_le();
16474 __struct.chan12_raw = buf.get_u16_le();
16475 __struct.rssi = buf.get_u8();
16476 Ok(__struct)
16477 }
16478 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16479 let mut __tmp = BytesMut::new(bytes);
16480 #[allow(clippy::absurd_extreme_comparisons)]
16481 #[allow(unused_comparisons)]
16482 if __tmp.remaining() < Self::ENCODED_LEN {
16483 panic!(
16484 "buffer is too small (need {} bytes, but got {})",
16485 Self::ENCODED_LEN,
16486 __tmp.remaining(),
16487 )
16488 }
16489 __tmp.put_u64_le(self.time_usec);
16490 __tmp.put_u16_le(self.chan1_raw);
16491 __tmp.put_u16_le(self.chan2_raw);
16492 __tmp.put_u16_le(self.chan3_raw);
16493 __tmp.put_u16_le(self.chan4_raw);
16494 __tmp.put_u16_le(self.chan5_raw);
16495 __tmp.put_u16_le(self.chan6_raw);
16496 __tmp.put_u16_le(self.chan7_raw);
16497 __tmp.put_u16_le(self.chan8_raw);
16498 __tmp.put_u16_le(self.chan9_raw);
16499 __tmp.put_u16_le(self.chan10_raw);
16500 __tmp.put_u16_le(self.chan11_raw);
16501 __tmp.put_u16_le(self.chan12_raw);
16502 __tmp.put_u8(self.rssi);
16503 if matches!(version, MavlinkVersion::V2) {
16504 let len = __tmp.len();
16505 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16506 } else {
16507 __tmp.len()
16508 }
16509 }
16510}
16511#[doc = "The IMU readings in SI units in NED body frame."]
16512#[doc = ""]
16513#[doc = "ID: 107"]
16514#[derive(Debug, Clone, PartialEq)]
16515#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16517pub struct HIL_SENSOR_DATA {
16518 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16519 pub time_usec: u64,
16520 #[doc = "X acceleration"]
16521 pub xacc: f32,
16522 #[doc = "Y acceleration"]
16523 pub yacc: f32,
16524 #[doc = "Z acceleration"]
16525 pub zacc: f32,
16526 #[doc = "Angular speed around X axis in body frame"]
16527 pub xgyro: f32,
16528 #[doc = "Angular speed around Y axis in body frame"]
16529 pub ygyro: f32,
16530 #[doc = "Angular speed around Z axis in body frame"]
16531 pub zgyro: f32,
16532 #[doc = "X Magnetic field"]
16533 pub xmag: f32,
16534 #[doc = "Y Magnetic field"]
16535 pub ymag: f32,
16536 #[doc = "Z Magnetic field"]
16537 pub zmag: f32,
16538 #[doc = "Absolute pressure"]
16539 pub abs_pressure: f32,
16540 #[doc = "Differential pressure (airspeed)"]
16541 pub diff_pressure: f32,
16542 #[doc = "Altitude calculated from pressure"]
16543 pub pressure_alt: f32,
16544 #[doc = "Temperature"]
16545 pub temperature: f32,
16546 #[doc = "Bitmap for fields that have updated since last message"]
16547 pub fields_updated: HilSensorUpdatedFlags,
16548 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16549 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16550 pub id: u8,
16551}
16552impl HIL_SENSOR_DATA {
16553 pub const ENCODED_LEN: usize = 65usize;
16554 pub const DEFAULT: Self = Self {
16555 time_usec: 0_u64,
16556 xacc: 0.0_f32,
16557 yacc: 0.0_f32,
16558 zacc: 0.0_f32,
16559 xgyro: 0.0_f32,
16560 ygyro: 0.0_f32,
16561 zgyro: 0.0_f32,
16562 xmag: 0.0_f32,
16563 ymag: 0.0_f32,
16564 zmag: 0.0_f32,
16565 abs_pressure: 0.0_f32,
16566 diff_pressure: 0.0_f32,
16567 pressure_alt: 0.0_f32,
16568 temperature: 0.0_f32,
16569 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16570 id: 0_u8,
16571 };
16572 #[cfg(feature = "arbitrary")]
16573 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16574 use arbitrary::{Arbitrary, Unstructured};
16575 let mut buf = [0u8; 1024];
16576 rng.fill_bytes(&mut buf);
16577 let mut unstructured = Unstructured::new(&buf);
16578 Self::arbitrary(&mut unstructured).unwrap_or_default()
16579 }
16580}
16581impl Default for HIL_SENSOR_DATA {
16582 fn default() -> Self {
16583 Self::DEFAULT.clone()
16584 }
16585}
16586impl MessageData for HIL_SENSOR_DATA {
16587 type Message = MavMessage;
16588 const ID: u32 = 107u32;
16589 const NAME: &'static str = "HIL_SENSOR";
16590 const EXTRA_CRC: u8 = 108u8;
16591 const ENCODED_LEN: usize = 65usize;
16592 fn deser(
16593 _version: MavlinkVersion,
16594 __input: &[u8],
16595 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16596 let avail_len = __input.len();
16597 let mut payload_buf = [0; Self::ENCODED_LEN];
16598 let mut buf = if avail_len < Self::ENCODED_LEN {
16599 payload_buf[0..avail_len].copy_from_slice(__input);
16600 Bytes::new(&payload_buf)
16601 } else {
16602 Bytes::new(__input)
16603 };
16604 let mut __struct = Self::default();
16605 __struct.time_usec = buf.get_u64_le();
16606 __struct.xacc = buf.get_f32_le();
16607 __struct.yacc = buf.get_f32_le();
16608 __struct.zacc = buf.get_f32_le();
16609 __struct.xgyro = buf.get_f32_le();
16610 __struct.ygyro = buf.get_f32_le();
16611 __struct.zgyro = buf.get_f32_le();
16612 __struct.xmag = buf.get_f32_le();
16613 __struct.ymag = buf.get_f32_le();
16614 __struct.zmag = buf.get_f32_le();
16615 __struct.abs_pressure = buf.get_f32_le();
16616 __struct.diff_pressure = buf.get_f32_le();
16617 __struct.pressure_alt = buf.get_f32_le();
16618 __struct.temperature = buf.get_f32_le();
16619 let tmp = buf.get_u32_le();
16620 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16621 tmp & HilSensorUpdatedFlags::all().bits(),
16622 )
16623 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16624 flag_type: "HilSensorUpdatedFlags",
16625 value: tmp as u32,
16626 })?;
16627 __struct.id = buf.get_u8();
16628 Ok(__struct)
16629 }
16630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16631 let mut __tmp = BytesMut::new(bytes);
16632 #[allow(clippy::absurd_extreme_comparisons)]
16633 #[allow(unused_comparisons)]
16634 if __tmp.remaining() < Self::ENCODED_LEN {
16635 panic!(
16636 "buffer is too small (need {} bytes, but got {})",
16637 Self::ENCODED_LEN,
16638 __tmp.remaining(),
16639 )
16640 }
16641 __tmp.put_u64_le(self.time_usec);
16642 __tmp.put_f32_le(self.xacc);
16643 __tmp.put_f32_le(self.yacc);
16644 __tmp.put_f32_le(self.zacc);
16645 __tmp.put_f32_le(self.xgyro);
16646 __tmp.put_f32_le(self.ygyro);
16647 __tmp.put_f32_le(self.zgyro);
16648 __tmp.put_f32_le(self.xmag);
16649 __tmp.put_f32_le(self.ymag);
16650 __tmp.put_f32_le(self.zmag);
16651 __tmp.put_f32_le(self.abs_pressure);
16652 __tmp.put_f32_le(self.diff_pressure);
16653 __tmp.put_f32_le(self.pressure_alt);
16654 __tmp.put_f32_le(self.temperature);
16655 __tmp.put_u32_le(self.fields_updated.bits());
16656 if matches!(version, MavlinkVersion::V2) {
16657 __tmp.put_u8(self.id);
16658 let len = __tmp.len();
16659 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16660 } else {
16661 __tmp.len()
16662 }
16663 }
16664}
16665#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16666#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16667#[doc = ""]
16668#[doc = "ID: 90"]
16669#[derive(Debug, Clone, PartialEq)]
16670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16672pub struct HIL_STATE_DATA {
16673 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16674 pub time_usec: u64,
16675 #[doc = "Roll angle"]
16676 pub roll: f32,
16677 #[doc = "Pitch angle"]
16678 pub pitch: f32,
16679 #[doc = "Yaw angle"]
16680 pub yaw: f32,
16681 #[doc = "Body frame roll / phi angular speed"]
16682 pub rollspeed: f32,
16683 #[doc = "Body frame pitch / theta angular speed"]
16684 pub pitchspeed: f32,
16685 #[doc = "Body frame yaw / psi angular speed"]
16686 pub yawspeed: f32,
16687 #[doc = "Latitude"]
16688 pub lat: i32,
16689 #[doc = "Longitude"]
16690 pub lon: i32,
16691 #[doc = "Altitude"]
16692 pub alt: i32,
16693 #[doc = "Ground X Speed (Latitude)"]
16694 pub vx: i16,
16695 #[doc = "Ground Y Speed (Longitude)"]
16696 pub vy: i16,
16697 #[doc = "Ground Z Speed (Altitude)"]
16698 pub vz: i16,
16699 #[doc = "X acceleration"]
16700 pub xacc: i16,
16701 #[doc = "Y acceleration"]
16702 pub yacc: i16,
16703 #[doc = "Z acceleration"]
16704 pub zacc: i16,
16705}
16706impl HIL_STATE_DATA {
16707 pub const ENCODED_LEN: usize = 56usize;
16708 pub const DEFAULT: Self = Self {
16709 time_usec: 0_u64,
16710 roll: 0.0_f32,
16711 pitch: 0.0_f32,
16712 yaw: 0.0_f32,
16713 rollspeed: 0.0_f32,
16714 pitchspeed: 0.0_f32,
16715 yawspeed: 0.0_f32,
16716 lat: 0_i32,
16717 lon: 0_i32,
16718 alt: 0_i32,
16719 vx: 0_i16,
16720 vy: 0_i16,
16721 vz: 0_i16,
16722 xacc: 0_i16,
16723 yacc: 0_i16,
16724 zacc: 0_i16,
16725 };
16726 #[cfg(feature = "arbitrary")]
16727 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16728 use arbitrary::{Arbitrary, Unstructured};
16729 let mut buf = [0u8; 1024];
16730 rng.fill_bytes(&mut buf);
16731 let mut unstructured = Unstructured::new(&buf);
16732 Self::arbitrary(&mut unstructured).unwrap_or_default()
16733 }
16734}
16735impl Default for HIL_STATE_DATA {
16736 fn default() -> Self {
16737 Self::DEFAULT.clone()
16738 }
16739}
16740impl MessageData for HIL_STATE_DATA {
16741 type Message = MavMessage;
16742 const ID: u32 = 90u32;
16743 const NAME: &'static str = "HIL_STATE";
16744 const EXTRA_CRC: u8 = 183u8;
16745 const ENCODED_LEN: usize = 56usize;
16746 fn deser(
16747 _version: MavlinkVersion,
16748 __input: &[u8],
16749 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16750 let avail_len = __input.len();
16751 let mut payload_buf = [0; Self::ENCODED_LEN];
16752 let mut buf = if avail_len < Self::ENCODED_LEN {
16753 payload_buf[0..avail_len].copy_from_slice(__input);
16754 Bytes::new(&payload_buf)
16755 } else {
16756 Bytes::new(__input)
16757 };
16758 let mut __struct = Self::default();
16759 __struct.time_usec = buf.get_u64_le();
16760 __struct.roll = buf.get_f32_le();
16761 __struct.pitch = buf.get_f32_le();
16762 __struct.yaw = buf.get_f32_le();
16763 __struct.rollspeed = buf.get_f32_le();
16764 __struct.pitchspeed = buf.get_f32_le();
16765 __struct.yawspeed = buf.get_f32_le();
16766 __struct.lat = buf.get_i32_le();
16767 __struct.lon = buf.get_i32_le();
16768 __struct.alt = buf.get_i32_le();
16769 __struct.vx = buf.get_i16_le();
16770 __struct.vy = buf.get_i16_le();
16771 __struct.vz = buf.get_i16_le();
16772 __struct.xacc = buf.get_i16_le();
16773 __struct.yacc = buf.get_i16_le();
16774 __struct.zacc = buf.get_i16_le();
16775 Ok(__struct)
16776 }
16777 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16778 let mut __tmp = BytesMut::new(bytes);
16779 #[allow(clippy::absurd_extreme_comparisons)]
16780 #[allow(unused_comparisons)]
16781 if __tmp.remaining() < Self::ENCODED_LEN {
16782 panic!(
16783 "buffer is too small (need {} bytes, but got {})",
16784 Self::ENCODED_LEN,
16785 __tmp.remaining(),
16786 )
16787 }
16788 __tmp.put_u64_le(self.time_usec);
16789 __tmp.put_f32_le(self.roll);
16790 __tmp.put_f32_le(self.pitch);
16791 __tmp.put_f32_le(self.yaw);
16792 __tmp.put_f32_le(self.rollspeed);
16793 __tmp.put_f32_le(self.pitchspeed);
16794 __tmp.put_f32_le(self.yawspeed);
16795 __tmp.put_i32_le(self.lat);
16796 __tmp.put_i32_le(self.lon);
16797 __tmp.put_i32_le(self.alt);
16798 __tmp.put_i16_le(self.vx);
16799 __tmp.put_i16_le(self.vy);
16800 __tmp.put_i16_le(self.vz);
16801 __tmp.put_i16_le(self.xacc);
16802 __tmp.put_i16_le(self.yacc);
16803 __tmp.put_i16_le(self.zacc);
16804 if matches!(version, MavlinkVersion::V2) {
16805 let len = __tmp.len();
16806 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16807 } else {
16808 __tmp.len()
16809 }
16810 }
16811}
16812#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16813#[doc = ""]
16814#[doc = "ID: 115"]
16815#[derive(Debug, Clone, PartialEq)]
16816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16817#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16818pub struct HIL_STATE_QUATERNION_DATA {
16819 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16820 pub time_usec: u64,
16821 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16822 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16823 pub attitude_quaternion: [f32; 4],
16824 #[doc = "Body frame roll / phi angular speed"]
16825 pub rollspeed: f32,
16826 #[doc = "Body frame pitch / theta angular speed"]
16827 pub pitchspeed: f32,
16828 #[doc = "Body frame yaw / psi angular speed"]
16829 pub yawspeed: f32,
16830 #[doc = "Latitude"]
16831 pub lat: i32,
16832 #[doc = "Longitude"]
16833 pub lon: i32,
16834 #[doc = "Altitude"]
16835 pub alt: i32,
16836 #[doc = "Ground X Speed (Latitude)"]
16837 pub vx: i16,
16838 #[doc = "Ground Y Speed (Longitude)"]
16839 pub vy: i16,
16840 #[doc = "Ground Z Speed (Altitude)"]
16841 pub vz: i16,
16842 #[doc = "Indicated airspeed"]
16843 pub ind_airspeed: u16,
16844 #[doc = "True airspeed"]
16845 pub true_airspeed: u16,
16846 #[doc = "X acceleration"]
16847 pub xacc: i16,
16848 #[doc = "Y acceleration"]
16849 pub yacc: i16,
16850 #[doc = "Z acceleration"]
16851 pub zacc: i16,
16852}
16853impl HIL_STATE_QUATERNION_DATA {
16854 pub const ENCODED_LEN: usize = 64usize;
16855 pub const DEFAULT: Self = Self {
16856 time_usec: 0_u64,
16857 attitude_quaternion: [0.0_f32; 4usize],
16858 rollspeed: 0.0_f32,
16859 pitchspeed: 0.0_f32,
16860 yawspeed: 0.0_f32,
16861 lat: 0_i32,
16862 lon: 0_i32,
16863 alt: 0_i32,
16864 vx: 0_i16,
16865 vy: 0_i16,
16866 vz: 0_i16,
16867 ind_airspeed: 0_u16,
16868 true_airspeed: 0_u16,
16869 xacc: 0_i16,
16870 yacc: 0_i16,
16871 zacc: 0_i16,
16872 };
16873 #[cfg(feature = "arbitrary")]
16874 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16875 use arbitrary::{Arbitrary, Unstructured};
16876 let mut buf = [0u8; 1024];
16877 rng.fill_bytes(&mut buf);
16878 let mut unstructured = Unstructured::new(&buf);
16879 Self::arbitrary(&mut unstructured).unwrap_or_default()
16880 }
16881}
16882impl Default for HIL_STATE_QUATERNION_DATA {
16883 fn default() -> Self {
16884 Self::DEFAULT.clone()
16885 }
16886}
16887impl MessageData for HIL_STATE_QUATERNION_DATA {
16888 type Message = MavMessage;
16889 const ID: u32 = 115u32;
16890 const NAME: &'static str = "HIL_STATE_QUATERNION";
16891 const EXTRA_CRC: u8 = 4u8;
16892 const ENCODED_LEN: usize = 64usize;
16893 fn deser(
16894 _version: MavlinkVersion,
16895 __input: &[u8],
16896 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16897 let avail_len = __input.len();
16898 let mut payload_buf = [0; Self::ENCODED_LEN];
16899 let mut buf = if avail_len < Self::ENCODED_LEN {
16900 payload_buf[0..avail_len].copy_from_slice(__input);
16901 Bytes::new(&payload_buf)
16902 } else {
16903 Bytes::new(__input)
16904 };
16905 let mut __struct = Self::default();
16906 __struct.time_usec = buf.get_u64_le();
16907 for v in &mut __struct.attitude_quaternion {
16908 let val = buf.get_f32_le();
16909 *v = val;
16910 }
16911 __struct.rollspeed = buf.get_f32_le();
16912 __struct.pitchspeed = buf.get_f32_le();
16913 __struct.yawspeed = buf.get_f32_le();
16914 __struct.lat = buf.get_i32_le();
16915 __struct.lon = buf.get_i32_le();
16916 __struct.alt = buf.get_i32_le();
16917 __struct.vx = buf.get_i16_le();
16918 __struct.vy = buf.get_i16_le();
16919 __struct.vz = buf.get_i16_le();
16920 __struct.ind_airspeed = buf.get_u16_le();
16921 __struct.true_airspeed = buf.get_u16_le();
16922 __struct.xacc = buf.get_i16_le();
16923 __struct.yacc = buf.get_i16_le();
16924 __struct.zacc = buf.get_i16_le();
16925 Ok(__struct)
16926 }
16927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16928 let mut __tmp = BytesMut::new(bytes);
16929 #[allow(clippy::absurd_extreme_comparisons)]
16930 #[allow(unused_comparisons)]
16931 if __tmp.remaining() < Self::ENCODED_LEN {
16932 panic!(
16933 "buffer is too small (need {} bytes, but got {})",
16934 Self::ENCODED_LEN,
16935 __tmp.remaining(),
16936 )
16937 }
16938 __tmp.put_u64_le(self.time_usec);
16939 for val in &self.attitude_quaternion {
16940 __tmp.put_f32_le(*val);
16941 }
16942 __tmp.put_f32_le(self.rollspeed);
16943 __tmp.put_f32_le(self.pitchspeed);
16944 __tmp.put_f32_le(self.yawspeed);
16945 __tmp.put_i32_le(self.lat);
16946 __tmp.put_i32_le(self.lon);
16947 __tmp.put_i32_le(self.alt);
16948 __tmp.put_i16_le(self.vx);
16949 __tmp.put_i16_le(self.vy);
16950 __tmp.put_i16_le(self.vz);
16951 __tmp.put_u16_le(self.ind_airspeed);
16952 __tmp.put_u16_le(self.true_airspeed);
16953 __tmp.put_i16_le(self.xacc);
16954 __tmp.put_i16_le(self.yacc);
16955 __tmp.put_i16_le(self.zacc);
16956 if matches!(version, MavlinkVersion::V2) {
16957 let len = __tmp.len();
16958 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16959 } else {
16960 __tmp.len()
16961 }
16962 }
16963}
16964#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16965#[doc = ""]
16966#[doc = "ID: 242"]
16967#[derive(Debug, Clone, PartialEq)]
16968#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16969#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16970pub struct HOME_POSITION_DATA {
16971 #[doc = "Latitude (WGS84)"]
16972 pub latitude: i32,
16973 #[doc = "Longitude (WGS84)"]
16974 pub longitude: i32,
16975 #[doc = "Altitude (MSL). Positive for up."]
16976 pub altitude: i32,
16977 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16978 pub x: f32,
16979 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16980 pub y: f32,
16981 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16982 pub z: f32,
16983 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16984 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16985 pub q: [f32; 4],
16986 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16987 pub approach_x: f32,
16988 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16989 pub approach_y: f32,
16990 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16991 pub approach_z: f32,
16992 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16993 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16994 pub time_usec: u64,
16995}
16996impl HOME_POSITION_DATA {
16997 pub const ENCODED_LEN: usize = 60usize;
16998 pub const DEFAULT: Self = Self {
16999 latitude: 0_i32,
17000 longitude: 0_i32,
17001 altitude: 0_i32,
17002 x: 0.0_f32,
17003 y: 0.0_f32,
17004 z: 0.0_f32,
17005 q: [0.0_f32; 4usize],
17006 approach_x: 0.0_f32,
17007 approach_y: 0.0_f32,
17008 approach_z: 0.0_f32,
17009 time_usec: 0_u64,
17010 };
17011 #[cfg(feature = "arbitrary")]
17012 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17013 use arbitrary::{Arbitrary, Unstructured};
17014 let mut buf = [0u8; 1024];
17015 rng.fill_bytes(&mut buf);
17016 let mut unstructured = Unstructured::new(&buf);
17017 Self::arbitrary(&mut unstructured).unwrap_or_default()
17018 }
17019}
17020impl Default for HOME_POSITION_DATA {
17021 fn default() -> Self {
17022 Self::DEFAULT.clone()
17023 }
17024}
17025impl MessageData for HOME_POSITION_DATA {
17026 type Message = MavMessage;
17027 const ID: u32 = 242u32;
17028 const NAME: &'static str = "HOME_POSITION";
17029 const EXTRA_CRC: u8 = 104u8;
17030 const ENCODED_LEN: usize = 60usize;
17031 fn deser(
17032 _version: MavlinkVersion,
17033 __input: &[u8],
17034 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17035 let avail_len = __input.len();
17036 let mut payload_buf = [0; Self::ENCODED_LEN];
17037 let mut buf = if avail_len < Self::ENCODED_LEN {
17038 payload_buf[0..avail_len].copy_from_slice(__input);
17039 Bytes::new(&payload_buf)
17040 } else {
17041 Bytes::new(__input)
17042 };
17043 let mut __struct = Self::default();
17044 __struct.latitude = buf.get_i32_le();
17045 __struct.longitude = buf.get_i32_le();
17046 __struct.altitude = buf.get_i32_le();
17047 __struct.x = buf.get_f32_le();
17048 __struct.y = buf.get_f32_le();
17049 __struct.z = buf.get_f32_le();
17050 for v in &mut __struct.q {
17051 let val = buf.get_f32_le();
17052 *v = val;
17053 }
17054 __struct.approach_x = buf.get_f32_le();
17055 __struct.approach_y = buf.get_f32_le();
17056 __struct.approach_z = buf.get_f32_le();
17057 __struct.time_usec = buf.get_u64_le();
17058 Ok(__struct)
17059 }
17060 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17061 let mut __tmp = BytesMut::new(bytes);
17062 #[allow(clippy::absurd_extreme_comparisons)]
17063 #[allow(unused_comparisons)]
17064 if __tmp.remaining() < Self::ENCODED_LEN {
17065 panic!(
17066 "buffer is too small (need {} bytes, but got {})",
17067 Self::ENCODED_LEN,
17068 __tmp.remaining(),
17069 )
17070 }
17071 __tmp.put_i32_le(self.latitude);
17072 __tmp.put_i32_le(self.longitude);
17073 __tmp.put_i32_le(self.altitude);
17074 __tmp.put_f32_le(self.x);
17075 __tmp.put_f32_le(self.y);
17076 __tmp.put_f32_le(self.z);
17077 for val in &self.q {
17078 __tmp.put_f32_le(*val);
17079 }
17080 __tmp.put_f32_le(self.approach_x);
17081 __tmp.put_f32_le(self.approach_y);
17082 __tmp.put_f32_le(self.approach_z);
17083 if matches!(version, MavlinkVersion::V2) {
17084 __tmp.put_u64_le(self.time_usec);
17085 let len = __tmp.len();
17086 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17087 } else {
17088 __tmp.len()
17089 }
17090 }
17091}
17092#[doc = "Temperature and humidity from hygrometer."]
17093#[doc = ""]
17094#[doc = "ID: 12920"]
17095#[derive(Debug, Clone, PartialEq)]
17096#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17097#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17098pub struct HYGROMETER_SENSOR_DATA {
17099 #[doc = "Temperature"]
17100 pub temperature: i16,
17101 #[doc = "Humidity"]
17102 pub humidity: u16,
17103 #[doc = "Hygrometer ID"]
17104 pub id: u8,
17105}
17106impl HYGROMETER_SENSOR_DATA {
17107 pub const ENCODED_LEN: usize = 5usize;
17108 pub const DEFAULT: Self = Self {
17109 temperature: 0_i16,
17110 humidity: 0_u16,
17111 id: 0_u8,
17112 };
17113 #[cfg(feature = "arbitrary")]
17114 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17115 use arbitrary::{Arbitrary, Unstructured};
17116 let mut buf = [0u8; 1024];
17117 rng.fill_bytes(&mut buf);
17118 let mut unstructured = Unstructured::new(&buf);
17119 Self::arbitrary(&mut unstructured).unwrap_or_default()
17120 }
17121}
17122impl Default for HYGROMETER_SENSOR_DATA {
17123 fn default() -> Self {
17124 Self::DEFAULT.clone()
17125 }
17126}
17127impl MessageData for HYGROMETER_SENSOR_DATA {
17128 type Message = MavMessage;
17129 const ID: u32 = 12920u32;
17130 const NAME: &'static str = "HYGROMETER_SENSOR";
17131 const EXTRA_CRC: u8 = 20u8;
17132 const ENCODED_LEN: usize = 5usize;
17133 fn deser(
17134 _version: MavlinkVersion,
17135 __input: &[u8],
17136 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17137 let avail_len = __input.len();
17138 let mut payload_buf = [0; Self::ENCODED_LEN];
17139 let mut buf = if avail_len < Self::ENCODED_LEN {
17140 payload_buf[0..avail_len].copy_from_slice(__input);
17141 Bytes::new(&payload_buf)
17142 } else {
17143 Bytes::new(__input)
17144 };
17145 let mut __struct = Self::default();
17146 __struct.temperature = buf.get_i16_le();
17147 __struct.humidity = buf.get_u16_le();
17148 __struct.id = buf.get_u8();
17149 Ok(__struct)
17150 }
17151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17152 let mut __tmp = BytesMut::new(bytes);
17153 #[allow(clippy::absurd_extreme_comparisons)]
17154 #[allow(unused_comparisons)]
17155 if __tmp.remaining() < Self::ENCODED_LEN {
17156 panic!(
17157 "buffer is too small (need {} bytes, but got {})",
17158 Self::ENCODED_LEN,
17159 __tmp.remaining(),
17160 )
17161 }
17162 __tmp.put_i16_le(self.temperature);
17163 __tmp.put_u16_le(self.humidity);
17164 __tmp.put_u8(self.id);
17165 if matches!(version, MavlinkVersion::V2) {
17166 let len = __tmp.len();
17167 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17168 } else {
17169 __tmp.len()
17170 }
17171 }
17172}
17173#[doc = "Illuminator status."]
17174#[doc = ""]
17175#[doc = "ID: 440"]
17176#[derive(Debug, Clone, PartialEq)]
17177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17179pub struct ILLUMINATOR_STATUS_DATA {
17180 #[doc = "Time since the start-up of the illuminator in ms"]
17181 pub uptime_ms: u32,
17182 #[doc = "Errors"]
17183 pub error_status: IlluminatorErrorFlags,
17184 #[doc = "Illuminator brightness"]
17185 pub brightness: f32,
17186 #[doc = "Illuminator strobing period in seconds"]
17187 pub strobe_period: f32,
17188 #[doc = "Illuminator strobing duty cycle"]
17189 pub strobe_duty_cycle: f32,
17190 #[doc = "Temperature in Celsius"]
17191 pub temp_c: f32,
17192 #[doc = "Minimum strobing period in seconds"]
17193 pub min_strobe_period: f32,
17194 #[doc = "Maximum strobing period in seconds"]
17195 pub max_strobe_period: f32,
17196 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17197 pub enable: u8,
17198 #[doc = "Supported illuminator modes"]
17199 pub mode_bitmask: IlluminatorMode,
17200 #[doc = "Illuminator mode"]
17201 pub mode: IlluminatorMode,
17202}
17203impl ILLUMINATOR_STATUS_DATA {
17204 pub const ENCODED_LEN: usize = 35usize;
17205 pub const DEFAULT: Self = Self {
17206 uptime_ms: 0_u32,
17207 error_status: IlluminatorErrorFlags::DEFAULT,
17208 brightness: 0.0_f32,
17209 strobe_period: 0.0_f32,
17210 strobe_duty_cycle: 0.0_f32,
17211 temp_c: 0.0_f32,
17212 min_strobe_period: 0.0_f32,
17213 max_strobe_period: 0.0_f32,
17214 enable: 0_u8,
17215 mode_bitmask: IlluminatorMode::DEFAULT,
17216 mode: IlluminatorMode::DEFAULT,
17217 };
17218 #[cfg(feature = "arbitrary")]
17219 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17220 use arbitrary::{Arbitrary, Unstructured};
17221 let mut buf = [0u8; 1024];
17222 rng.fill_bytes(&mut buf);
17223 let mut unstructured = Unstructured::new(&buf);
17224 Self::arbitrary(&mut unstructured).unwrap_or_default()
17225 }
17226}
17227impl Default for ILLUMINATOR_STATUS_DATA {
17228 fn default() -> Self {
17229 Self::DEFAULT.clone()
17230 }
17231}
17232impl MessageData for ILLUMINATOR_STATUS_DATA {
17233 type Message = MavMessage;
17234 const ID: u32 = 440u32;
17235 const NAME: &'static str = "ILLUMINATOR_STATUS";
17236 const EXTRA_CRC: u8 = 66u8;
17237 const ENCODED_LEN: usize = 35usize;
17238 fn deser(
17239 _version: MavlinkVersion,
17240 __input: &[u8],
17241 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17242 let avail_len = __input.len();
17243 let mut payload_buf = [0; Self::ENCODED_LEN];
17244 let mut buf = if avail_len < Self::ENCODED_LEN {
17245 payload_buf[0..avail_len].copy_from_slice(__input);
17246 Bytes::new(&payload_buf)
17247 } else {
17248 Bytes::new(__input)
17249 };
17250 let mut __struct = Self::default();
17251 __struct.uptime_ms = buf.get_u32_le();
17252 let tmp = buf.get_u32_le();
17253 __struct.error_status = IlluminatorErrorFlags::from_bits(
17254 tmp & IlluminatorErrorFlags::all().bits(),
17255 )
17256 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17257 flag_type: "IlluminatorErrorFlags",
17258 value: tmp as u32,
17259 })?;
17260 __struct.brightness = buf.get_f32_le();
17261 __struct.strobe_period = buf.get_f32_le();
17262 __struct.strobe_duty_cycle = buf.get_f32_le();
17263 __struct.temp_c = buf.get_f32_le();
17264 __struct.min_strobe_period = buf.get_f32_le();
17265 __struct.max_strobe_period = buf.get_f32_le();
17266 __struct.enable = buf.get_u8();
17267 let tmp = buf.get_u8();
17268 __struct.mode_bitmask =
17269 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17270 enum_type: "IlluminatorMode",
17271 value: tmp as u32,
17272 })?;
17273 let tmp = buf.get_u8();
17274 __struct.mode =
17275 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17276 enum_type: "IlluminatorMode",
17277 value: tmp as u32,
17278 })?;
17279 Ok(__struct)
17280 }
17281 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17282 let mut __tmp = BytesMut::new(bytes);
17283 #[allow(clippy::absurd_extreme_comparisons)]
17284 #[allow(unused_comparisons)]
17285 if __tmp.remaining() < Self::ENCODED_LEN {
17286 panic!(
17287 "buffer is too small (need {} bytes, but got {})",
17288 Self::ENCODED_LEN,
17289 __tmp.remaining(),
17290 )
17291 }
17292 __tmp.put_u32_le(self.uptime_ms);
17293 __tmp.put_u32_le(self.error_status.bits());
17294 __tmp.put_f32_le(self.brightness);
17295 __tmp.put_f32_le(self.strobe_period);
17296 __tmp.put_f32_le(self.strobe_duty_cycle);
17297 __tmp.put_f32_le(self.temp_c);
17298 __tmp.put_f32_le(self.min_strobe_period);
17299 __tmp.put_f32_le(self.max_strobe_period);
17300 __tmp.put_u8(self.enable);
17301 __tmp.put_u8(self.mode_bitmask as u8);
17302 __tmp.put_u8(self.mode as u8);
17303 if matches!(version, MavlinkVersion::V2) {
17304 let len = __tmp.len();
17305 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17306 } else {
17307 __tmp.len()
17308 }
17309 }
17310}
17311#[doc = "Status of the Iridium SBD link."]
17312#[doc = ""]
17313#[doc = "ID: 335"]
17314#[derive(Debug, Clone, PartialEq)]
17315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17317pub struct ISBD_LINK_STATUS_DATA {
17318 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17319 pub timestamp: u64,
17320 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17321 pub last_heartbeat: u64,
17322 #[doc = "Number of failed SBD sessions."]
17323 pub failed_sessions: u16,
17324 #[doc = "Number of successful SBD sessions."]
17325 pub successful_sessions: u16,
17326 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17327 pub signal_quality: u8,
17328 #[doc = "1: Ring call pending, 0: No call pending."]
17329 pub ring_pending: u8,
17330 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17331 pub tx_session_pending: u8,
17332 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17333 pub rx_session_pending: u8,
17334}
17335impl ISBD_LINK_STATUS_DATA {
17336 pub const ENCODED_LEN: usize = 24usize;
17337 pub const DEFAULT: Self = Self {
17338 timestamp: 0_u64,
17339 last_heartbeat: 0_u64,
17340 failed_sessions: 0_u16,
17341 successful_sessions: 0_u16,
17342 signal_quality: 0_u8,
17343 ring_pending: 0_u8,
17344 tx_session_pending: 0_u8,
17345 rx_session_pending: 0_u8,
17346 };
17347 #[cfg(feature = "arbitrary")]
17348 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17349 use arbitrary::{Arbitrary, Unstructured};
17350 let mut buf = [0u8; 1024];
17351 rng.fill_bytes(&mut buf);
17352 let mut unstructured = Unstructured::new(&buf);
17353 Self::arbitrary(&mut unstructured).unwrap_or_default()
17354 }
17355}
17356impl Default for ISBD_LINK_STATUS_DATA {
17357 fn default() -> Self {
17358 Self::DEFAULT.clone()
17359 }
17360}
17361impl MessageData for ISBD_LINK_STATUS_DATA {
17362 type Message = MavMessage;
17363 const ID: u32 = 335u32;
17364 const NAME: &'static str = "ISBD_LINK_STATUS";
17365 const EXTRA_CRC: u8 = 225u8;
17366 const ENCODED_LEN: usize = 24usize;
17367 fn deser(
17368 _version: MavlinkVersion,
17369 __input: &[u8],
17370 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17371 let avail_len = __input.len();
17372 let mut payload_buf = [0; Self::ENCODED_LEN];
17373 let mut buf = if avail_len < Self::ENCODED_LEN {
17374 payload_buf[0..avail_len].copy_from_slice(__input);
17375 Bytes::new(&payload_buf)
17376 } else {
17377 Bytes::new(__input)
17378 };
17379 let mut __struct = Self::default();
17380 __struct.timestamp = buf.get_u64_le();
17381 __struct.last_heartbeat = buf.get_u64_le();
17382 __struct.failed_sessions = buf.get_u16_le();
17383 __struct.successful_sessions = buf.get_u16_le();
17384 __struct.signal_quality = buf.get_u8();
17385 __struct.ring_pending = buf.get_u8();
17386 __struct.tx_session_pending = buf.get_u8();
17387 __struct.rx_session_pending = buf.get_u8();
17388 Ok(__struct)
17389 }
17390 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17391 let mut __tmp = BytesMut::new(bytes);
17392 #[allow(clippy::absurd_extreme_comparisons)]
17393 #[allow(unused_comparisons)]
17394 if __tmp.remaining() < Self::ENCODED_LEN {
17395 panic!(
17396 "buffer is too small (need {} bytes, but got {})",
17397 Self::ENCODED_LEN,
17398 __tmp.remaining(),
17399 )
17400 }
17401 __tmp.put_u64_le(self.timestamp);
17402 __tmp.put_u64_le(self.last_heartbeat);
17403 __tmp.put_u16_le(self.failed_sessions);
17404 __tmp.put_u16_le(self.successful_sessions);
17405 __tmp.put_u8(self.signal_quality);
17406 __tmp.put_u8(self.ring_pending);
17407 __tmp.put_u8(self.tx_session_pending);
17408 __tmp.put_u8(self.rx_session_pending);
17409 if matches!(version, MavlinkVersion::V2) {
17410 let len = __tmp.len();
17411 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17412 } else {
17413 __tmp.len()
17414 }
17415 }
17416}
17417#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17418#[doc = ""]
17419#[doc = "ID: 149"]
17420#[derive(Debug, Clone, PartialEq)]
17421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17423pub struct LANDING_TARGET_DATA {
17424 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17425 pub time_usec: u64,
17426 #[doc = "X-axis angular offset of the target from the center of the image"]
17427 pub angle_x: f32,
17428 #[doc = "Y-axis angular offset of the target from the center of the image"]
17429 pub angle_y: f32,
17430 #[doc = "Distance to the target from the vehicle"]
17431 pub distance: f32,
17432 #[doc = "Size of target along x-axis"]
17433 pub size_x: f32,
17434 #[doc = "Size of target along y-axis"]
17435 pub size_y: f32,
17436 #[doc = "The ID of the target if multiple targets are present"]
17437 pub target_num: u8,
17438 #[doc = "Coordinate frame used for following fields."]
17439 pub frame: MavFrame,
17440 #[doc = "X Position of the landing target in MAV_FRAME"]
17441 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17442 pub x: f32,
17443 #[doc = "Y Position of the landing target in MAV_FRAME"]
17444 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17445 pub y: f32,
17446 #[doc = "Z Position of the landing target in MAV_FRAME"]
17447 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17448 pub z: f32,
17449 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17450 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17451 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17452 pub q: [f32; 4],
17453 #[doc = "Type of landing target"]
17454 #[cfg_attr(feature = "serde", serde(default))]
17455 pub mavtype: LandingTargetType,
17456 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17457 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17458 pub position_valid: u8,
17459}
17460impl LANDING_TARGET_DATA {
17461 pub const ENCODED_LEN: usize = 60usize;
17462 pub const DEFAULT: Self = Self {
17463 time_usec: 0_u64,
17464 angle_x: 0.0_f32,
17465 angle_y: 0.0_f32,
17466 distance: 0.0_f32,
17467 size_x: 0.0_f32,
17468 size_y: 0.0_f32,
17469 target_num: 0_u8,
17470 frame: MavFrame::DEFAULT,
17471 x: 0.0_f32,
17472 y: 0.0_f32,
17473 z: 0.0_f32,
17474 q: [0.0_f32; 4usize],
17475 mavtype: LandingTargetType::DEFAULT,
17476 position_valid: 0_u8,
17477 };
17478 #[cfg(feature = "arbitrary")]
17479 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17480 use arbitrary::{Arbitrary, Unstructured};
17481 let mut buf = [0u8; 1024];
17482 rng.fill_bytes(&mut buf);
17483 let mut unstructured = Unstructured::new(&buf);
17484 Self::arbitrary(&mut unstructured).unwrap_or_default()
17485 }
17486}
17487impl Default for LANDING_TARGET_DATA {
17488 fn default() -> Self {
17489 Self::DEFAULT.clone()
17490 }
17491}
17492impl MessageData for LANDING_TARGET_DATA {
17493 type Message = MavMessage;
17494 const ID: u32 = 149u32;
17495 const NAME: &'static str = "LANDING_TARGET";
17496 const EXTRA_CRC: u8 = 200u8;
17497 const ENCODED_LEN: usize = 60usize;
17498 fn deser(
17499 _version: MavlinkVersion,
17500 __input: &[u8],
17501 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17502 let avail_len = __input.len();
17503 let mut payload_buf = [0; Self::ENCODED_LEN];
17504 let mut buf = if avail_len < Self::ENCODED_LEN {
17505 payload_buf[0..avail_len].copy_from_slice(__input);
17506 Bytes::new(&payload_buf)
17507 } else {
17508 Bytes::new(__input)
17509 };
17510 let mut __struct = Self::default();
17511 __struct.time_usec = buf.get_u64_le();
17512 __struct.angle_x = buf.get_f32_le();
17513 __struct.angle_y = buf.get_f32_le();
17514 __struct.distance = buf.get_f32_le();
17515 __struct.size_x = buf.get_f32_le();
17516 __struct.size_y = buf.get_f32_le();
17517 __struct.target_num = buf.get_u8();
17518 let tmp = buf.get_u8();
17519 __struct.frame =
17520 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17521 enum_type: "MavFrame",
17522 value: tmp as u32,
17523 })?;
17524 __struct.x = buf.get_f32_le();
17525 __struct.y = buf.get_f32_le();
17526 __struct.z = buf.get_f32_le();
17527 for v in &mut __struct.q {
17528 let val = buf.get_f32_le();
17529 *v = val;
17530 }
17531 let tmp = buf.get_u8();
17532 __struct.mavtype =
17533 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17534 enum_type: "LandingTargetType",
17535 value: tmp as u32,
17536 })?;
17537 __struct.position_valid = buf.get_u8();
17538 Ok(__struct)
17539 }
17540 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17541 let mut __tmp = BytesMut::new(bytes);
17542 #[allow(clippy::absurd_extreme_comparisons)]
17543 #[allow(unused_comparisons)]
17544 if __tmp.remaining() < Self::ENCODED_LEN {
17545 panic!(
17546 "buffer is too small (need {} bytes, but got {})",
17547 Self::ENCODED_LEN,
17548 __tmp.remaining(),
17549 )
17550 }
17551 __tmp.put_u64_le(self.time_usec);
17552 __tmp.put_f32_le(self.angle_x);
17553 __tmp.put_f32_le(self.angle_y);
17554 __tmp.put_f32_le(self.distance);
17555 __tmp.put_f32_le(self.size_x);
17556 __tmp.put_f32_le(self.size_y);
17557 __tmp.put_u8(self.target_num);
17558 __tmp.put_u8(self.frame as u8);
17559 if matches!(version, MavlinkVersion::V2) {
17560 __tmp.put_f32_le(self.x);
17561 __tmp.put_f32_le(self.y);
17562 __tmp.put_f32_le(self.z);
17563 for val in &self.q {
17564 __tmp.put_f32_le(*val);
17565 }
17566 __tmp.put_u8(self.mavtype as u8);
17567 __tmp.put_u8(self.position_valid);
17568 let len = __tmp.len();
17569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17570 } else {
17571 __tmp.len()
17572 }
17573 }
17574}
17575#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17576#[doc = ""]
17577#[doc = "ID: 8"]
17578#[derive(Debug, Clone, PartialEq)]
17579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17581pub struct LINK_NODE_STATUS_DATA {
17582 #[doc = "Timestamp (time since system boot)."]
17583 pub timestamp: u64,
17584 #[doc = "Transmit rate"]
17585 pub tx_rate: u32,
17586 #[doc = "Receive rate"]
17587 pub rx_rate: u32,
17588 #[doc = "Messages sent"]
17589 pub messages_sent: u32,
17590 #[doc = "Messages received (estimated from counting seq)"]
17591 pub messages_received: u32,
17592 #[doc = "Messages lost (estimated from counting seq)"]
17593 pub messages_lost: u32,
17594 #[doc = "Number of bytes that could not be parsed correctly."]
17595 pub rx_parse_err: u16,
17596 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17597 pub tx_overflows: u16,
17598 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17599 pub rx_overflows: u16,
17600 #[doc = "Remaining free transmit buffer space"]
17601 pub tx_buf: u8,
17602 #[doc = "Remaining free receive buffer space"]
17603 pub rx_buf: u8,
17604}
17605impl LINK_NODE_STATUS_DATA {
17606 pub const ENCODED_LEN: usize = 36usize;
17607 pub const DEFAULT: Self = Self {
17608 timestamp: 0_u64,
17609 tx_rate: 0_u32,
17610 rx_rate: 0_u32,
17611 messages_sent: 0_u32,
17612 messages_received: 0_u32,
17613 messages_lost: 0_u32,
17614 rx_parse_err: 0_u16,
17615 tx_overflows: 0_u16,
17616 rx_overflows: 0_u16,
17617 tx_buf: 0_u8,
17618 rx_buf: 0_u8,
17619 };
17620 #[cfg(feature = "arbitrary")]
17621 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17622 use arbitrary::{Arbitrary, Unstructured};
17623 let mut buf = [0u8; 1024];
17624 rng.fill_bytes(&mut buf);
17625 let mut unstructured = Unstructured::new(&buf);
17626 Self::arbitrary(&mut unstructured).unwrap_or_default()
17627 }
17628}
17629impl Default for LINK_NODE_STATUS_DATA {
17630 fn default() -> Self {
17631 Self::DEFAULT.clone()
17632 }
17633}
17634impl MessageData for LINK_NODE_STATUS_DATA {
17635 type Message = MavMessage;
17636 const ID: u32 = 8u32;
17637 const NAME: &'static str = "LINK_NODE_STATUS";
17638 const EXTRA_CRC: u8 = 117u8;
17639 const ENCODED_LEN: usize = 36usize;
17640 fn deser(
17641 _version: MavlinkVersion,
17642 __input: &[u8],
17643 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17644 let avail_len = __input.len();
17645 let mut payload_buf = [0; Self::ENCODED_LEN];
17646 let mut buf = if avail_len < Self::ENCODED_LEN {
17647 payload_buf[0..avail_len].copy_from_slice(__input);
17648 Bytes::new(&payload_buf)
17649 } else {
17650 Bytes::new(__input)
17651 };
17652 let mut __struct = Self::default();
17653 __struct.timestamp = buf.get_u64_le();
17654 __struct.tx_rate = buf.get_u32_le();
17655 __struct.rx_rate = buf.get_u32_le();
17656 __struct.messages_sent = buf.get_u32_le();
17657 __struct.messages_received = buf.get_u32_le();
17658 __struct.messages_lost = buf.get_u32_le();
17659 __struct.rx_parse_err = buf.get_u16_le();
17660 __struct.tx_overflows = buf.get_u16_le();
17661 __struct.rx_overflows = buf.get_u16_le();
17662 __struct.tx_buf = buf.get_u8();
17663 __struct.rx_buf = buf.get_u8();
17664 Ok(__struct)
17665 }
17666 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17667 let mut __tmp = BytesMut::new(bytes);
17668 #[allow(clippy::absurd_extreme_comparisons)]
17669 #[allow(unused_comparisons)]
17670 if __tmp.remaining() < Self::ENCODED_LEN {
17671 panic!(
17672 "buffer is too small (need {} bytes, but got {})",
17673 Self::ENCODED_LEN,
17674 __tmp.remaining(),
17675 )
17676 }
17677 __tmp.put_u64_le(self.timestamp);
17678 __tmp.put_u32_le(self.tx_rate);
17679 __tmp.put_u32_le(self.rx_rate);
17680 __tmp.put_u32_le(self.messages_sent);
17681 __tmp.put_u32_le(self.messages_received);
17682 __tmp.put_u32_le(self.messages_lost);
17683 __tmp.put_u16_le(self.rx_parse_err);
17684 __tmp.put_u16_le(self.tx_overflows);
17685 __tmp.put_u16_le(self.rx_overflows);
17686 __tmp.put_u8(self.tx_buf);
17687 __tmp.put_u8(self.rx_buf);
17688 if matches!(version, MavlinkVersion::V2) {
17689 let len = __tmp.len();
17690 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17691 } else {
17692 __tmp.len()
17693 }
17694 }
17695}
17696#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17697#[doc = ""]
17698#[doc = "ID: 32"]
17699#[derive(Debug, Clone, PartialEq)]
17700#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17702pub struct LOCAL_POSITION_NED_DATA {
17703 #[doc = "Timestamp (time since system boot)."]
17704 pub time_boot_ms: u32,
17705 #[doc = "X Position"]
17706 pub x: f32,
17707 #[doc = "Y Position"]
17708 pub y: f32,
17709 #[doc = "Z Position"]
17710 pub z: f32,
17711 #[doc = "X Speed"]
17712 pub vx: f32,
17713 #[doc = "Y Speed"]
17714 pub vy: f32,
17715 #[doc = "Z Speed"]
17716 pub vz: f32,
17717}
17718impl LOCAL_POSITION_NED_DATA {
17719 pub const ENCODED_LEN: usize = 28usize;
17720 pub const DEFAULT: Self = Self {
17721 time_boot_ms: 0_u32,
17722 x: 0.0_f32,
17723 y: 0.0_f32,
17724 z: 0.0_f32,
17725 vx: 0.0_f32,
17726 vy: 0.0_f32,
17727 vz: 0.0_f32,
17728 };
17729 #[cfg(feature = "arbitrary")]
17730 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17731 use arbitrary::{Arbitrary, Unstructured};
17732 let mut buf = [0u8; 1024];
17733 rng.fill_bytes(&mut buf);
17734 let mut unstructured = Unstructured::new(&buf);
17735 Self::arbitrary(&mut unstructured).unwrap_or_default()
17736 }
17737}
17738impl Default for LOCAL_POSITION_NED_DATA {
17739 fn default() -> Self {
17740 Self::DEFAULT.clone()
17741 }
17742}
17743impl MessageData for LOCAL_POSITION_NED_DATA {
17744 type Message = MavMessage;
17745 const ID: u32 = 32u32;
17746 const NAME: &'static str = "LOCAL_POSITION_NED";
17747 const EXTRA_CRC: u8 = 185u8;
17748 const ENCODED_LEN: usize = 28usize;
17749 fn deser(
17750 _version: MavlinkVersion,
17751 __input: &[u8],
17752 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17753 let avail_len = __input.len();
17754 let mut payload_buf = [0; Self::ENCODED_LEN];
17755 let mut buf = if avail_len < Self::ENCODED_LEN {
17756 payload_buf[0..avail_len].copy_from_slice(__input);
17757 Bytes::new(&payload_buf)
17758 } else {
17759 Bytes::new(__input)
17760 };
17761 let mut __struct = Self::default();
17762 __struct.time_boot_ms = buf.get_u32_le();
17763 __struct.x = buf.get_f32_le();
17764 __struct.y = buf.get_f32_le();
17765 __struct.z = buf.get_f32_le();
17766 __struct.vx = buf.get_f32_le();
17767 __struct.vy = buf.get_f32_le();
17768 __struct.vz = buf.get_f32_le();
17769 Ok(__struct)
17770 }
17771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17772 let mut __tmp = BytesMut::new(bytes);
17773 #[allow(clippy::absurd_extreme_comparisons)]
17774 #[allow(unused_comparisons)]
17775 if __tmp.remaining() < Self::ENCODED_LEN {
17776 panic!(
17777 "buffer is too small (need {} bytes, but got {})",
17778 Self::ENCODED_LEN,
17779 __tmp.remaining(),
17780 )
17781 }
17782 __tmp.put_u32_le(self.time_boot_ms);
17783 __tmp.put_f32_le(self.x);
17784 __tmp.put_f32_le(self.y);
17785 __tmp.put_f32_le(self.z);
17786 __tmp.put_f32_le(self.vx);
17787 __tmp.put_f32_le(self.vy);
17788 __tmp.put_f32_le(self.vz);
17789 if matches!(version, MavlinkVersion::V2) {
17790 let len = __tmp.len();
17791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17792 } else {
17793 __tmp.len()
17794 }
17795 }
17796}
17797#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17798#[doc = ""]
17799#[doc = "ID: 64"]
17800#[derive(Debug, Clone, PartialEq)]
17801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17803pub struct LOCAL_POSITION_NED_COV_DATA {
17804 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17805 pub time_usec: u64,
17806 #[doc = "X Position"]
17807 pub x: f32,
17808 #[doc = "Y Position"]
17809 pub y: f32,
17810 #[doc = "Z Position"]
17811 pub z: f32,
17812 #[doc = "X Speed"]
17813 pub vx: f32,
17814 #[doc = "Y Speed"]
17815 pub vy: f32,
17816 #[doc = "Z Speed"]
17817 pub vz: f32,
17818 #[doc = "X Acceleration"]
17819 pub ax: f32,
17820 #[doc = "Y Acceleration"]
17821 pub ay: f32,
17822 #[doc = "Z Acceleration"]
17823 pub az: f32,
17824 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17825 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17826 pub covariance: [f32; 45],
17827 #[doc = "Class id of the estimator this estimate originated from."]
17828 pub estimator_type: MavEstimatorType,
17829}
17830impl LOCAL_POSITION_NED_COV_DATA {
17831 pub const ENCODED_LEN: usize = 225usize;
17832 pub const DEFAULT: Self = Self {
17833 time_usec: 0_u64,
17834 x: 0.0_f32,
17835 y: 0.0_f32,
17836 z: 0.0_f32,
17837 vx: 0.0_f32,
17838 vy: 0.0_f32,
17839 vz: 0.0_f32,
17840 ax: 0.0_f32,
17841 ay: 0.0_f32,
17842 az: 0.0_f32,
17843 covariance: [0.0_f32; 45usize],
17844 estimator_type: MavEstimatorType::DEFAULT,
17845 };
17846 #[cfg(feature = "arbitrary")]
17847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17848 use arbitrary::{Arbitrary, Unstructured};
17849 let mut buf = [0u8; 1024];
17850 rng.fill_bytes(&mut buf);
17851 let mut unstructured = Unstructured::new(&buf);
17852 Self::arbitrary(&mut unstructured).unwrap_or_default()
17853 }
17854}
17855impl Default for LOCAL_POSITION_NED_COV_DATA {
17856 fn default() -> Self {
17857 Self::DEFAULT.clone()
17858 }
17859}
17860impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17861 type Message = MavMessage;
17862 const ID: u32 = 64u32;
17863 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17864 const EXTRA_CRC: u8 = 191u8;
17865 const ENCODED_LEN: usize = 225usize;
17866 fn deser(
17867 _version: MavlinkVersion,
17868 __input: &[u8],
17869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17870 let avail_len = __input.len();
17871 let mut payload_buf = [0; Self::ENCODED_LEN];
17872 let mut buf = if avail_len < Self::ENCODED_LEN {
17873 payload_buf[0..avail_len].copy_from_slice(__input);
17874 Bytes::new(&payload_buf)
17875 } else {
17876 Bytes::new(__input)
17877 };
17878 let mut __struct = Self::default();
17879 __struct.time_usec = buf.get_u64_le();
17880 __struct.x = buf.get_f32_le();
17881 __struct.y = buf.get_f32_le();
17882 __struct.z = buf.get_f32_le();
17883 __struct.vx = buf.get_f32_le();
17884 __struct.vy = buf.get_f32_le();
17885 __struct.vz = buf.get_f32_le();
17886 __struct.ax = buf.get_f32_le();
17887 __struct.ay = buf.get_f32_le();
17888 __struct.az = buf.get_f32_le();
17889 for v in &mut __struct.covariance {
17890 let val = buf.get_f32_le();
17891 *v = val;
17892 }
17893 let tmp = buf.get_u8();
17894 __struct.estimator_type =
17895 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17896 enum_type: "MavEstimatorType",
17897 value: tmp as u32,
17898 })?;
17899 Ok(__struct)
17900 }
17901 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17902 let mut __tmp = BytesMut::new(bytes);
17903 #[allow(clippy::absurd_extreme_comparisons)]
17904 #[allow(unused_comparisons)]
17905 if __tmp.remaining() < Self::ENCODED_LEN {
17906 panic!(
17907 "buffer is too small (need {} bytes, but got {})",
17908 Self::ENCODED_LEN,
17909 __tmp.remaining(),
17910 )
17911 }
17912 __tmp.put_u64_le(self.time_usec);
17913 __tmp.put_f32_le(self.x);
17914 __tmp.put_f32_le(self.y);
17915 __tmp.put_f32_le(self.z);
17916 __tmp.put_f32_le(self.vx);
17917 __tmp.put_f32_le(self.vy);
17918 __tmp.put_f32_le(self.vz);
17919 __tmp.put_f32_le(self.ax);
17920 __tmp.put_f32_le(self.ay);
17921 __tmp.put_f32_le(self.az);
17922 for val in &self.covariance {
17923 __tmp.put_f32_le(*val);
17924 }
17925 __tmp.put_u8(self.estimator_type as u8);
17926 if matches!(version, MavlinkVersion::V2) {
17927 let len = __tmp.len();
17928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17929 } else {
17930 __tmp.len()
17931 }
17932 }
17933}
17934#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17935#[doc = ""]
17936#[doc = "ID: 89"]
17937#[derive(Debug, Clone, PartialEq)]
17938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17940pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17941 #[doc = "Timestamp (time since system boot)."]
17942 pub time_boot_ms: u32,
17943 #[doc = "X Position"]
17944 pub x: f32,
17945 #[doc = "Y Position"]
17946 pub y: f32,
17947 #[doc = "Z Position"]
17948 pub z: f32,
17949 #[doc = "Roll"]
17950 pub roll: f32,
17951 #[doc = "Pitch"]
17952 pub pitch: f32,
17953 #[doc = "Yaw"]
17954 pub yaw: f32,
17955}
17956impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17957 pub const ENCODED_LEN: usize = 28usize;
17958 pub const DEFAULT: Self = Self {
17959 time_boot_ms: 0_u32,
17960 x: 0.0_f32,
17961 y: 0.0_f32,
17962 z: 0.0_f32,
17963 roll: 0.0_f32,
17964 pitch: 0.0_f32,
17965 yaw: 0.0_f32,
17966 };
17967 #[cfg(feature = "arbitrary")]
17968 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17969 use arbitrary::{Arbitrary, Unstructured};
17970 let mut buf = [0u8; 1024];
17971 rng.fill_bytes(&mut buf);
17972 let mut unstructured = Unstructured::new(&buf);
17973 Self::arbitrary(&mut unstructured).unwrap_or_default()
17974 }
17975}
17976impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17977 fn default() -> Self {
17978 Self::DEFAULT.clone()
17979 }
17980}
17981impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17982 type Message = MavMessage;
17983 const ID: u32 = 89u32;
17984 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17985 const EXTRA_CRC: u8 = 231u8;
17986 const ENCODED_LEN: usize = 28usize;
17987 fn deser(
17988 _version: MavlinkVersion,
17989 __input: &[u8],
17990 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17991 let avail_len = __input.len();
17992 let mut payload_buf = [0; Self::ENCODED_LEN];
17993 let mut buf = if avail_len < Self::ENCODED_LEN {
17994 payload_buf[0..avail_len].copy_from_slice(__input);
17995 Bytes::new(&payload_buf)
17996 } else {
17997 Bytes::new(__input)
17998 };
17999 let mut __struct = Self::default();
18000 __struct.time_boot_ms = buf.get_u32_le();
18001 __struct.x = buf.get_f32_le();
18002 __struct.y = buf.get_f32_le();
18003 __struct.z = buf.get_f32_le();
18004 __struct.roll = buf.get_f32_le();
18005 __struct.pitch = buf.get_f32_le();
18006 __struct.yaw = buf.get_f32_le();
18007 Ok(__struct)
18008 }
18009 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18010 let mut __tmp = BytesMut::new(bytes);
18011 #[allow(clippy::absurd_extreme_comparisons)]
18012 #[allow(unused_comparisons)]
18013 if __tmp.remaining() < Self::ENCODED_LEN {
18014 panic!(
18015 "buffer is too small (need {} bytes, but got {})",
18016 Self::ENCODED_LEN,
18017 __tmp.remaining(),
18018 )
18019 }
18020 __tmp.put_u32_le(self.time_boot_ms);
18021 __tmp.put_f32_le(self.x);
18022 __tmp.put_f32_le(self.y);
18023 __tmp.put_f32_le(self.z);
18024 __tmp.put_f32_le(self.roll);
18025 __tmp.put_f32_le(self.pitch);
18026 __tmp.put_f32_le(self.yaw);
18027 if matches!(version, MavlinkVersion::V2) {
18028 let len = __tmp.len();
18029 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18030 } else {
18031 __tmp.len()
18032 }
18033 }
18034}
18035#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18036#[doc = ""]
18037#[doc = "ID: 268"]
18038#[derive(Debug, Clone, PartialEq)]
18039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18040#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18041pub struct LOGGING_ACK_DATA {
18042 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18043 pub sequence: u16,
18044 #[doc = "system ID of the target"]
18045 pub target_system: u8,
18046 #[doc = "component ID of the target"]
18047 pub target_component: u8,
18048}
18049impl LOGGING_ACK_DATA {
18050 pub const ENCODED_LEN: usize = 4usize;
18051 pub const DEFAULT: Self = Self {
18052 sequence: 0_u16,
18053 target_system: 0_u8,
18054 target_component: 0_u8,
18055 };
18056 #[cfg(feature = "arbitrary")]
18057 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18058 use arbitrary::{Arbitrary, Unstructured};
18059 let mut buf = [0u8; 1024];
18060 rng.fill_bytes(&mut buf);
18061 let mut unstructured = Unstructured::new(&buf);
18062 Self::arbitrary(&mut unstructured).unwrap_or_default()
18063 }
18064}
18065impl Default for LOGGING_ACK_DATA {
18066 fn default() -> Self {
18067 Self::DEFAULT.clone()
18068 }
18069}
18070impl MessageData for LOGGING_ACK_DATA {
18071 type Message = MavMessage;
18072 const ID: u32 = 268u32;
18073 const NAME: &'static str = "LOGGING_ACK";
18074 const EXTRA_CRC: u8 = 14u8;
18075 const ENCODED_LEN: usize = 4usize;
18076 fn deser(
18077 _version: MavlinkVersion,
18078 __input: &[u8],
18079 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18080 let avail_len = __input.len();
18081 let mut payload_buf = [0; Self::ENCODED_LEN];
18082 let mut buf = if avail_len < Self::ENCODED_LEN {
18083 payload_buf[0..avail_len].copy_from_slice(__input);
18084 Bytes::new(&payload_buf)
18085 } else {
18086 Bytes::new(__input)
18087 };
18088 let mut __struct = Self::default();
18089 __struct.sequence = buf.get_u16_le();
18090 __struct.target_system = buf.get_u8();
18091 __struct.target_component = buf.get_u8();
18092 Ok(__struct)
18093 }
18094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18095 let mut __tmp = BytesMut::new(bytes);
18096 #[allow(clippy::absurd_extreme_comparisons)]
18097 #[allow(unused_comparisons)]
18098 if __tmp.remaining() < Self::ENCODED_LEN {
18099 panic!(
18100 "buffer is too small (need {} bytes, but got {})",
18101 Self::ENCODED_LEN,
18102 __tmp.remaining(),
18103 )
18104 }
18105 __tmp.put_u16_le(self.sequence);
18106 __tmp.put_u8(self.target_system);
18107 __tmp.put_u8(self.target_component);
18108 if matches!(version, MavlinkVersion::V2) {
18109 let len = __tmp.len();
18110 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18111 } else {
18112 __tmp.len()
18113 }
18114 }
18115}
18116#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18117#[doc = ""]
18118#[doc = "ID: 266"]
18119#[derive(Debug, Clone, PartialEq)]
18120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18121#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18122pub struct LOGGING_DATA_DATA {
18123 #[doc = "sequence number (can wrap)"]
18124 pub sequence: u16,
18125 #[doc = "system ID of the target"]
18126 pub target_system: u8,
18127 #[doc = "component ID of the target"]
18128 pub target_component: u8,
18129 #[doc = "data length"]
18130 pub length: u8,
18131 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18132 pub first_message_offset: u8,
18133 #[doc = "logged data"]
18134 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18135 pub data: [u8; 249],
18136}
18137impl LOGGING_DATA_DATA {
18138 pub const ENCODED_LEN: usize = 255usize;
18139 pub const DEFAULT: Self = Self {
18140 sequence: 0_u16,
18141 target_system: 0_u8,
18142 target_component: 0_u8,
18143 length: 0_u8,
18144 first_message_offset: 0_u8,
18145 data: [0_u8; 249usize],
18146 };
18147 #[cfg(feature = "arbitrary")]
18148 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18149 use arbitrary::{Arbitrary, Unstructured};
18150 let mut buf = [0u8; 1024];
18151 rng.fill_bytes(&mut buf);
18152 let mut unstructured = Unstructured::new(&buf);
18153 Self::arbitrary(&mut unstructured).unwrap_or_default()
18154 }
18155}
18156impl Default for LOGGING_DATA_DATA {
18157 fn default() -> Self {
18158 Self::DEFAULT.clone()
18159 }
18160}
18161impl MessageData for LOGGING_DATA_DATA {
18162 type Message = MavMessage;
18163 const ID: u32 = 266u32;
18164 const NAME: &'static str = "LOGGING_DATA";
18165 const EXTRA_CRC: u8 = 193u8;
18166 const ENCODED_LEN: usize = 255usize;
18167 fn deser(
18168 _version: MavlinkVersion,
18169 __input: &[u8],
18170 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18171 let avail_len = __input.len();
18172 let mut payload_buf = [0; Self::ENCODED_LEN];
18173 let mut buf = if avail_len < Self::ENCODED_LEN {
18174 payload_buf[0..avail_len].copy_from_slice(__input);
18175 Bytes::new(&payload_buf)
18176 } else {
18177 Bytes::new(__input)
18178 };
18179 let mut __struct = Self::default();
18180 __struct.sequence = buf.get_u16_le();
18181 __struct.target_system = buf.get_u8();
18182 __struct.target_component = buf.get_u8();
18183 __struct.length = buf.get_u8();
18184 __struct.first_message_offset = buf.get_u8();
18185 for v in &mut __struct.data {
18186 let val = buf.get_u8();
18187 *v = val;
18188 }
18189 Ok(__struct)
18190 }
18191 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18192 let mut __tmp = BytesMut::new(bytes);
18193 #[allow(clippy::absurd_extreme_comparisons)]
18194 #[allow(unused_comparisons)]
18195 if __tmp.remaining() < Self::ENCODED_LEN {
18196 panic!(
18197 "buffer is too small (need {} bytes, but got {})",
18198 Self::ENCODED_LEN,
18199 __tmp.remaining(),
18200 )
18201 }
18202 __tmp.put_u16_le(self.sequence);
18203 __tmp.put_u8(self.target_system);
18204 __tmp.put_u8(self.target_component);
18205 __tmp.put_u8(self.length);
18206 __tmp.put_u8(self.first_message_offset);
18207 for val in &self.data {
18208 __tmp.put_u8(*val);
18209 }
18210 if matches!(version, MavlinkVersion::V2) {
18211 let len = __tmp.len();
18212 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18213 } else {
18214 __tmp.len()
18215 }
18216 }
18217}
18218#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18219#[doc = ""]
18220#[doc = "ID: 267"]
18221#[derive(Debug, Clone, PartialEq)]
18222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18224pub struct LOGGING_DATA_ACKED_DATA {
18225 #[doc = "sequence number (can wrap)"]
18226 pub sequence: u16,
18227 #[doc = "system ID of the target"]
18228 pub target_system: u8,
18229 #[doc = "component ID of the target"]
18230 pub target_component: u8,
18231 #[doc = "data length"]
18232 pub length: u8,
18233 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18234 pub first_message_offset: u8,
18235 #[doc = "logged data"]
18236 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18237 pub data: [u8; 249],
18238}
18239impl LOGGING_DATA_ACKED_DATA {
18240 pub const ENCODED_LEN: usize = 255usize;
18241 pub const DEFAULT: Self = Self {
18242 sequence: 0_u16,
18243 target_system: 0_u8,
18244 target_component: 0_u8,
18245 length: 0_u8,
18246 first_message_offset: 0_u8,
18247 data: [0_u8; 249usize],
18248 };
18249 #[cfg(feature = "arbitrary")]
18250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18251 use arbitrary::{Arbitrary, Unstructured};
18252 let mut buf = [0u8; 1024];
18253 rng.fill_bytes(&mut buf);
18254 let mut unstructured = Unstructured::new(&buf);
18255 Self::arbitrary(&mut unstructured).unwrap_or_default()
18256 }
18257}
18258impl Default for LOGGING_DATA_ACKED_DATA {
18259 fn default() -> Self {
18260 Self::DEFAULT.clone()
18261 }
18262}
18263impl MessageData for LOGGING_DATA_ACKED_DATA {
18264 type Message = MavMessage;
18265 const ID: u32 = 267u32;
18266 const NAME: &'static str = "LOGGING_DATA_ACKED";
18267 const EXTRA_CRC: u8 = 35u8;
18268 const ENCODED_LEN: usize = 255usize;
18269 fn deser(
18270 _version: MavlinkVersion,
18271 __input: &[u8],
18272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18273 let avail_len = __input.len();
18274 let mut payload_buf = [0; Self::ENCODED_LEN];
18275 let mut buf = if avail_len < Self::ENCODED_LEN {
18276 payload_buf[0..avail_len].copy_from_slice(__input);
18277 Bytes::new(&payload_buf)
18278 } else {
18279 Bytes::new(__input)
18280 };
18281 let mut __struct = Self::default();
18282 __struct.sequence = buf.get_u16_le();
18283 __struct.target_system = buf.get_u8();
18284 __struct.target_component = buf.get_u8();
18285 __struct.length = buf.get_u8();
18286 __struct.first_message_offset = buf.get_u8();
18287 for v in &mut __struct.data {
18288 let val = buf.get_u8();
18289 *v = val;
18290 }
18291 Ok(__struct)
18292 }
18293 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18294 let mut __tmp = BytesMut::new(bytes);
18295 #[allow(clippy::absurd_extreme_comparisons)]
18296 #[allow(unused_comparisons)]
18297 if __tmp.remaining() < Self::ENCODED_LEN {
18298 panic!(
18299 "buffer is too small (need {} bytes, but got {})",
18300 Self::ENCODED_LEN,
18301 __tmp.remaining(),
18302 )
18303 }
18304 __tmp.put_u16_le(self.sequence);
18305 __tmp.put_u8(self.target_system);
18306 __tmp.put_u8(self.target_component);
18307 __tmp.put_u8(self.length);
18308 __tmp.put_u8(self.first_message_offset);
18309 for val in &self.data {
18310 __tmp.put_u8(*val);
18311 }
18312 if matches!(version, MavlinkVersion::V2) {
18313 let len = __tmp.len();
18314 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18315 } else {
18316 __tmp.len()
18317 }
18318 }
18319}
18320#[doc = "Reply to LOG_REQUEST_DATA."]
18321#[doc = ""]
18322#[doc = "ID: 120"]
18323#[derive(Debug, Clone, PartialEq)]
18324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18326pub struct LOG_DATA_DATA {
18327 #[doc = "Offset into the log"]
18328 pub ofs: u32,
18329 #[doc = "Log id (from LOG_ENTRY reply)"]
18330 pub id: u16,
18331 #[doc = "Number of bytes (zero for end of log)"]
18332 pub count: u8,
18333 #[doc = "log data"]
18334 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18335 pub data: [u8; 90],
18336}
18337impl LOG_DATA_DATA {
18338 pub const ENCODED_LEN: usize = 97usize;
18339 pub const DEFAULT: Self = Self {
18340 ofs: 0_u32,
18341 id: 0_u16,
18342 count: 0_u8,
18343 data: [0_u8; 90usize],
18344 };
18345 #[cfg(feature = "arbitrary")]
18346 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18347 use arbitrary::{Arbitrary, Unstructured};
18348 let mut buf = [0u8; 1024];
18349 rng.fill_bytes(&mut buf);
18350 let mut unstructured = Unstructured::new(&buf);
18351 Self::arbitrary(&mut unstructured).unwrap_or_default()
18352 }
18353}
18354impl Default for LOG_DATA_DATA {
18355 fn default() -> Self {
18356 Self::DEFAULT.clone()
18357 }
18358}
18359impl MessageData for LOG_DATA_DATA {
18360 type Message = MavMessage;
18361 const ID: u32 = 120u32;
18362 const NAME: &'static str = "LOG_DATA";
18363 const EXTRA_CRC: u8 = 134u8;
18364 const ENCODED_LEN: usize = 97usize;
18365 fn deser(
18366 _version: MavlinkVersion,
18367 __input: &[u8],
18368 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18369 let avail_len = __input.len();
18370 let mut payload_buf = [0; Self::ENCODED_LEN];
18371 let mut buf = if avail_len < Self::ENCODED_LEN {
18372 payload_buf[0..avail_len].copy_from_slice(__input);
18373 Bytes::new(&payload_buf)
18374 } else {
18375 Bytes::new(__input)
18376 };
18377 let mut __struct = Self::default();
18378 __struct.ofs = buf.get_u32_le();
18379 __struct.id = buf.get_u16_le();
18380 __struct.count = buf.get_u8();
18381 for v in &mut __struct.data {
18382 let val = buf.get_u8();
18383 *v = val;
18384 }
18385 Ok(__struct)
18386 }
18387 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18388 let mut __tmp = BytesMut::new(bytes);
18389 #[allow(clippy::absurd_extreme_comparisons)]
18390 #[allow(unused_comparisons)]
18391 if __tmp.remaining() < Self::ENCODED_LEN {
18392 panic!(
18393 "buffer is too small (need {} bytes, but got {})",
18394 Self::ENCODED_LEN,
18395 __tmp.remaining(),
18396 )
18397 }
18398 __tmp.put_u32_le(self.ofs);
18399 __tmp.put_u16_le(self.id);
18400 __tmp.put_u8(self.count);
18401 for val in &self.data {
18402 __tmp.put_u8(*val);
18403 }
18404 if matches!(version, MavlinkVersion::V2) {
18405 let len = __tmp.len();
18406 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18407 } else {
18408 __tmp.len()
18409 }
18410 }
18411}
18412#[doc = "Reply to LOG_REQUEST_LIST."]
18413#[doc = ""]
18414#[doc = "ID: 118"]
18415#[derive(Debug, Clone, PartialEq)]
18416#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18417#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18418pub struct LOG_ENTRY_DATA {
18419 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18420 pub time_utc: u32,
18421 #[doc = "Size of the log (may be approximate)"]
18422 pub size: u32,
18423 #[doc = "Log id"]
18424 pub id: u16,
18425 #[doc = "Total number of logs"]
18426 pub num_logs: u16,
18427 #[doc = "High log number"]
18428 pub last_log_num: u16,
18429}
18430impl LOG_ENTRY_DATA {
18431 pub const ENCODED_LEN: usize = 14usize;
18432 pub const DEFAULT: Self = Self {
18433 time_utc: 0_u32,
18434 size: 0_u32,
18435 id: 0_u16,
18436 num_logs: 0_u16,
18437 last_log_num: 0_u16,
18438 };
18439 #[cfg(feature = "arbitrary")]
18440 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18441 use arbitrary::{Arbitrary, Unstructured};
18442 let mut buf = [0u8; 1024];
18443 rng.fill_bytes(&mut buf);
18444 let mut unstructured = Unstructured::new(&buf);
18445 Self::arbitrary(&mut unstructured).unwrap_or_default()
18446 }
18447}
18448impl Default for LOG_ENTRY_DATA {
18449 fn default() -> Self {
18450 Self::DEFAULT.clone()
18451 }
18452}
18453impl MessageData for LOG_ENTRY_DATA {
18454 type Message = MavMessage;
18455 const ID: u32 = 118u32;
18456 const NAME: &'static str = "LOG_ENTRY";
18457 const EXTRA_CRC: u8 = 56u8;
18458 const ENCODED_LEN: usize = 14usize;
18459 fn deser(
18460 _version: MavlinkVersion,
18461 __input: &[u8],
18462 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18463 let avail_len = __input.len();
18464 let mut payload_buf = [0; Self::ENCODED_LEN];
18465 let mut buf = if avail_len < Self::ENCODED_LEN {
18466 payload_buf[0..avail_len].copy_from_slice(__input);
18467 Bytes::new(&payload_buf)
18468 } else {
18469 Bytes::new(__input)
18470 };
18471 let mut __struct = Self::default();
18472 __struct.time_utc = buf.get_u32_le();
18473 __struct.size = buf.get_u32_le();
18474 __struct.id = buf.get_u16_le();
18475 __struct.num_logs = buf.get_u16_le();
18476 __struct.last_log_num = buf.get_u16_le();
18477 Ok(__struct)
18478 }
18479 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18480 let mut __tmp = BytesMut::new(bytes);
18481 #[allow(clippy::absurd_extreme_comparisons)]
18482 #[allow(unused_comparisons)]
18483 if __tmp.remaining() < Self::ENCODED_LEN {
18484 panic!(
18485 "buffer is too small (need {} bytes, but got {})",
18486 Self::ENCODED_LEN,
18487 __tmp.remaining(),
18488 )
18489 }
18490 __tmp.put_u32_le(self.time_utc);
18491 __tmp.put_u32_le(self.size);
18492 __tmp.put_u16_le(self.id);
18493 __tmp.put_u16_le(self.num_logs);
18494 __tmp.put_u16_le(self.last_log_num);
18495 if matches!(version, MavlinkVersion::V2) {
18496 let len = __tmp.len();
18497 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18498 } else {
18499 __tmp.len()
18500 }
18501 }
18502}
18503#[doc = "Erase all logs."]
18504#[doc = ""]
18505#[doc = "ID: 121"]
18506#[derive(Debug, Clone, PartialEq)]
18507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18509pub struct LOG_ERASE_DATA {
18510 #[doc = "System ID"]
18511 pub target_system: u8,
18512 #[doc = "Component ID"]
18513 pub target_component: u8,
18514}
18515impl LOG_ERASE_DATA {
18516 pub const ENCODED_LEN: usize = 2usize;
18517 pub const DEFAULT: Self = Self {
18518 target_system: 0_u8,
18519 target_component: 0_u8,
18520 };
18521 #[cfg(feature = "arbitrary")]
18522 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18523 use arbitrary::{Arbitrary, Unstructured};
18524 let mut buf = [0u8; 1024];
18525 rng.fill_bytes(&mut buf);
18526 let mut unstructured = Unstructured::new(&buf);
18527 Self::arbitrary(&mut unstructured).unwrap_or_default()
18528 }
18529}
18530impl Default for LOG_ERASE_DATA {
18531 fn default() -> Self {
18532 Self::DEFAULT.clone()
18533 }
18534}
18535impl MessageData for LOG_ERASE_DATA {
18536 type Message = MavMessage;
18537 const ID: u32 = 121u32;
18538 const NAME: &'static str = "LOG_ERASE";
18539 const EXTRA_CRC: u8 = 237u8;
18540 const ENCODED_LEN: usize = 2usize;
18541 fn deser(
18542 _version: MavlinkVersion,
18543 __input: &[u8],
18544 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18545 let avail_len = __input.len();
18546 let mut payload_buf = [0; Self::ENCODED_LEN];
18547 let mut buf = if avail_len < Self::ENCODED_LEN {
18548 payload_buf[0..avail_len].copy_from_slice(__input);
18549 Bytes::new(&payload_buf)
18550 } else {
18551 Bytes::new(__input)
18552 };
18553 let mut __struct = Self::default();
18554 __struct.target_system = buf.get_u8();
18555 __struct.target_component = buf.get_u8();
18556 Ok(__struct)
18557 }
18558 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18559 let mut __tmp = BytesMut::new(bytes);
18560 #[allow(clippy::absurd_extreme_comparisons)]
18561 #[allow(unused_comparisons)]
18562 if __tmp.remaining() < Self::ENCODED_LEN {
18563 panic!(
18564 "buffer is too small (need {} bytes, but got {})",
18565 Self::ENCODED_LEN,
18566 __tmp.remaining(),
18567 )
18568 }
18569 __tmp.put_u8(self.target_system);
18570 __tmp.put_u8(self.target_component);
18571 if matches!(version, MavlinkVersion::V2) {
18572 let len = __tmp.len();
18573 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18574 } else {
18575 __tmp.len()
18576 }
18577 }
18578}
18579#[doc = "Request a chunk of a log."]
18580#[doc = ""]
18581#[doc = "ID: 119"]
18582#[derive(Debug, Clone, PartialEq)]
18583#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18585pub struct LOG_REQUEST_DATA_DATA {
18586 #[doc = "Offset into the log"]
18587 pub ofs: u32,
18588 #[doc = "Number of bytes"]
18589 pub count: u32,
18590 #[doc = "Log id (from LOG_ENTRY reply)"]
18591 pub id: u16,
18592 #[doc = "System ID"]
18593 pub target_system: u8,
18594 #[doc = "Component ID"]
18595 pub target_component: u8,
18596}
18597impl LOG_REQUEST_DATA_DATA {
18598 pub const ENCODED_LEN: usize = 12usize;
18599 pub const DEFAULT: Self = Self {
18600 ofs: 0_u32,
18601 count: 0_u32,
18602 id: 0_u16,
18603 target_system: 0_u8,
18604 target_component: 0_u8,
18605 };
18606 #[cfg(feature = "arbitrary")]
18607 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18608 use arbitrary::{Arbitrary, Unstructured};
18609 let mut buf = [0u8; 1024];
18610 rng.fill_bytes(&mut buf);
18611 let mut unstructured = Unstructured::new(&buf);
18612 Self::arbitrary(&mut unstructured).unwrap_or_default()
18613 }
18614}
18615impl Default for LOG_REQUEST_DATA_DATA {
18616 fn default() -> Self {
18617 Self::DEFAULT.clone()
18618 }
18619}
18620impl MessageData for LOG_REQUEST_DATA_DATA {
18621 type Message = MavMessage;
18622 const ID: u32 = 119u32;
18623 const NAME: &'static str = "LOG_REQUEST_DATA";
18624 const EXTRA_CRC: u8 = 116u8;
18625 const ENCODED_LEN: usize = 12usize;
18626 fn deser(
18627 _version: MavlinkVersion,
18628 __input: &[u8],
18629 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18630 let avail_len = __input.len();
18631 let mut payload_buf = [0; Self::ENCODED_LEN];
18632 let mut buf = if avail_len < Self::ENCODED_LEN {
18633 payload_buf[0..avail_len].copy_from_slice(__input);
18634 Bytes::new(&payload_buf)
18635 } else {
18636 Bytes::new(__input)
18637 };
18638 let mut __struct = Self::default();
18639 __struct.ofs = buf.get_u32_le();
18640 __struct.count = buf.get_u32_le();
18641 __struct.id = buf.get_u16_le();
18642 __struct.target_system = buf.get_u8();
18643 __struct.target_component = buf.get_u8();
18644 Ok(__struct)
18645 }
18646 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18647 let mut __tmp = BytesMut::new(bytes);
18648 #[allow(clippy::absurd_extreme_comparisons)]
18649 #[allow(unused_comparisons)]
18650 if __tmp.remaining() < Self::ENCODED_LEN {
18651 panic!(
18652 "buffer is too small (need {} bytes, but got {})",
18653 Self::ENCODED_LEN,
18654 __tmp.remaining(),
18655 )
18656 }
18657 __tmp.put_u32_le(self.ofs);
18658 __tmp.put_u32_le(self.count);
18659 __tmp.put_u16_le(self.id);
18660 __tmp.put_u8(self.target_system);
18661 __tmp.put_u8(self.target_component);
18662 if matches!(version, MavlinkVersion::V2) {
18663 let len = __tmp.len();
18664 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18665 } else {
18666 __tmp.len()
18667 }
18668 }
18669}
18670#[doc = "Stop log transfer and resume normal logging."]
18671#[doc = ""]
18672#[doc = "ID: 122"]
18673#[derive(Debug, Clone, PartialEq)]
18674#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18675#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18676pub struct LOG_REQUEST_END_DATA {
18677 #[doc = "System ID"]
18678 pub target_system: u8,
18679 #[doc = "Component ID"]
18680 pub target_component: u8,
18681}
18682impl LOG_REQUEST_END_DATA {
18683 pub const ENCODED_LEN: usize = 2usize;
18684 pub const DEFAULT: Self = Self {
18685 target_system: 0_u8,
18686 target_component: 0_u8,
18687 };
18688 #[cfg(feature = "arbitrary")]
18689 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18690 use arbitrary::{Arbitrary, Unstructured};
18691 let mut buf = [0u8; 1024];
18692 rng.fill_bytes(&mut buf);
18693 let mut unstructured = Unstructured::new(&buf);
18694 Self::arbitrary(&mut unstructured).unwrap_or_default()
18695 }
18696}
18697impl Default for LOG_REQUEST_END_DATA {
18698 fn default() -> Self {
18699 Self::DEFAULT.clone()
18700 }
18701}
18702impl MessageData for LOG_REQUEST_END_DATA {
18703 type Message = MavMessage;
18704 const ID: u32 = 122u32;
18705 const NAME: &'static str = "LOG_REQUEST_END";
18706 const EXTRA_CRC: u8 = 203u8;
18707 const ENCODED_LEN: usize = 2usize;
18708 fn deser(
18709 _version: MavlinkVersion,
18710 __input: &[u8],
18711 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18712 let avail_len = __input.len();
18713 let mut payload_buf = [0; Self::ENCODED_LEN];
18714 let mut buf = if avail_len < Self::ENCODED_LEN {
18715 payload_buf[0..avail_len].copy_from_slice(__input);
18716 Bytes::new(&payload_buf)
18717 } else {
18718 Bytes::new(__input)
18719 };
18720 let mut __struct = Self::default();
18721 __struct.target_system = buf.get_u8();
18722 __struct.target_component = buf.get_u8();
18723 Ok(__struct)
18724 }
18725 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18726 let mut __tmp = BytesMut::new(bytes);
18727 #[allow(clippy::absurd_extreme_comparisons)]
18728 #[allow(unused_comparisons)]
18729 if __tmp.remaining() < Self::ENCODED_LEN {
18730 panic!(
18731 "buffer is too small (need {} bytes, but got {})",
18732 Self::ENCODED_LEN,
18733 __tmp.remaining(),
18734 )
18735 }
18736 __tmp.put_u8(self.target_system);
18737 __tmp.put_u8(self.target_component);
18738 if matches!(version, MavlinkVersion::V2) {
18739 let len = __tmp.len();
18740 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18741 } else {
18742 __tmp.len()
18743 }
18744 }
18745}
18746#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18747#[doc = ""]
18748#[doc = "ID: 117"]
18749#[derive(Debug, Clone, PartialEq)]
18750#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18751#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18752pub struct LOG_REQUEST_LIST_DATA {
18753 #[doc = "First log id (0 for first available)"]
18754 pub start: u16,
18755 #[doc = "Last log id (0xffff for last available)"]
18756 pub end: u16,
18757 #[doc = "System ID"]
18758 pub target_system: u8,
18759 #[doc = "Component ID"]
18760 pub target_component: u8,
18761}
18762impl LOG_REQUEST_LIST_DATA {
18763 pub const ENCODED_LEN: usize = 6usize;
18764 pub const DEFAULT: Self = Self {
18765 start: 0_u16,
18766 end: 0_u16,
18767 target_system: 0_u8,
18768 target_component: 0_u8,
18769 };
18770 #[cfg(feature = "arbitrary")]
18771 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18772 use arbitrary::{Arbitrary, Unstructured};
18773 let mut buf = [0u8; 1024];
18774 rng.fill_bytes(&mut buf);
18775 let mut unstructured = Unstructured::new(&buf);
18776 Self::arbitrary(&mut unstructured).unwrap_or_default()
18777 }
18778}
18779impl Default for LOG_REQUEST_LIST_DATA {
18780 fn default() -> Self {
18781 Self::DEFAULT.clone()
18782 }
18783}
18784impl MessageData for LOG_REQUEST_LIST_DATA {
18785 type Message = MavMessage;
18786 const ID: u32 = 117u32;
18787 const NAME: &'static str = "LOG_REQUEST_LIST";
18788 const EXTRA_CRC: u8 = 128u8;
18789 const ENCODED_LEN: usize = 6usize;
18790 fn deser(
18791 _version: MavlinkVersion,
18792 __input: &[u8],
18793 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18794 let avail_len = __input.len();
18795 let mut payload_buf = [0; Self::ENCODED_LEN];
18796 let mut buf = if avail_len < Self::ENCODED_LEN {
18797 payload_buf[0..avail_len].copy_from_slice(__input);
18798 Bytes::new(&payload_buf)
18799 } else {
18800 Bytes::new(__input)
18801 };
18802 let mut __struct = Self::default();
18803 __struct.start = buf.get_u16_le();
18804 __struct.end = buf.get_u16_le();
18805 __struct.target_system = buf.get_u8();
18806 __struct.target_component = buf.get_u8();
18807 Ok(__struct)
18808 }
18809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18810 let mut __tmp = BytesMut::new(bytes);
18811 #[allow(clippy::absurd_extreme_comparisons)]
18812 #[allow(unused_comparisons)]
18813 if __tmp.remaining() < Self::ENCODED_LEN {
18814 panic!(
18815 "buffer is too small (need {} bytes, but got {})",
18816 Self::ENCODED_LEN,
18817 __tmp.remaining(),
18818 )
18819 }
18820 __tmp.put_u16_le(self.start);
18821 __tmp.put_u16_le(self.end);
18822 __tmp.put_u8(self.target_system);
18823 __tmp.put_u8(self.target_component);
18824 if matches!(version, MavlinkVersion::V2) {
18825 let len = __tmp.len();
18826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18827 } else {
18828 __tmp.len()
18829 }
18830 }
18831}
18832#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18833#[doc = ""]
18834#[doc = "ID: 192"]
18835#[derive(Debug, Clone, PartialEq)]
18836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18837#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18838pub struct MAG_CAL_REPORT_DATA {
18839 #[doc = "RMS milligauss residuals."]
18840 pub fitness: f32,
18841 #[doc = "X offset."]
18842 pub ofs_x: f32,
18843 #[doc = "Y offset."]
18844 pub ofs_y: f32,
18845 #[doc = "Z offset."]
18846 pub ofs_z: f32,
18847 #[doc = "X diagonal (matrix 11)."]
18848 pub diag_x: f32,
18849 #[doc = "Y diagonal (matrix 22)."]
18850 pub diag_y: f32,
18851 #[doc = "Z diagonal (matrix 33)."]
18852 pub diag_z: f32,
18853 #[doc = "X off-diagonal (matrix 12 and 21)."]
18854 pub offdiag_x: f32,
18855 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18856 pub offdiag_y: f32,
18857 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18858 pub offdiag_z: f32,
18859 #[doc = "Compass being calibrated."]
18860 pub compass_id: u8,
18861 #[doc = "Bitmask of compasses being calibrated."]
18862 pub cal_mask: u8,
18863 #[doc = "Calibration Status."]
18864 pub cal_status: MagCalStatus,
18865 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18866 pub autosaved: u8,
18867 #[doc = "Confidence in orientation (higher is better)."]
18868 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18869 pub orientation_confidence: f32,
18870 #[doc = "orientation before calibration."]
18871 #[cfg_attr(feature = "serde", serde(default))]
18872 pub old_orientation: MavSensorOrientation,
18873 #[doc = "orientation after calibration."]
18874 #[cfg_attr(feature = "serde", serde(default))]
18875 pub new_orientation: MavSensorOrientation,
18876 #[doc = "field radius correction factor"]
18877 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18878 pub scale_factor: f32,
18879}
18880impl MAG_CAL_REPORT_DATA {
18881 pub const ENCODED_LEN: usize = 54usize;
18882 pub const DEFAULT: Self = Self {
18883 fitness: 0.0_f32,
18884 ofs_x: 0.0_f32,
18885 ofs_y: 0.0_f32,
18886 ofs_z: 0.0_f32,
18887 diag_x: 0.0_f32,
18888 diag_y: 0.0_f32,
18889 diag_z: 0.0_f32,
18890 offdiag_x: 0.0_f32,
18891 offdiag_y: 0.0_f32,
18892 offdiag_z: 0.0_f32,
18893 compass_id: 0_u8,
18894 cal_mask: 0_u8,
18895 cal_status: MagCalStatus::DEFAULT,
18896 autosaved: 0_u8,
18897 orientation_confidence: 0.0_f32,
18898 old_orientation: MavSensorOrientation::DEFAULT,
18899 new_orientation: MavSensorOrientation::DEFAULT,
18900 scale_factor: 0.0_f32,
18901 };
18902 #[cfg(feature = "arbitrary")]
18903 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18904 use arbitrary::{Arbitrary, Unstructured};
18905 let mut buf = [0u8; 1024];
18906 rng.fill_bytes(&mut buf);
18907 let mut unstructured = Unstructured::new(&buf);
18908 Self::arbitrary(&mut unstructured).unwrap_or_default()
18909 }
18910}
18911impl Default for MAG_CAL_REPORT_DATA {
18912 fn default() -> Self {
18913 Self::DEFAULT.clone()
18914 }
18915}
18916impl MessageData for MAG_CAL_REPORT_DATA {
18917 type Message = MavMessage;
18918 const ID: u32 = 192u32;
18919 const NAME: &'static str = "MAG_CAL_REPORT";
18920 const EXTRA_CRC: u8 = 36u8;
18921 const ENCODED_LEN: usize = 54usize;
18922 fn deser(
18923 _version: MavlinkVersion,
18924 __input: &[u8],
18925 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18926 let avail_len = __input.len();
18927 let mut payload_buf = [0; Self::ENCODED_LEN];
18928 let mut buf = if avail_len < Self::ENCODED_LEN {
18929 payload_buf[0..avail_len].copy_from_slice(__input);
18930 Bytes::new(&payload_buf)
18931 } else {
18932 Bytes::new(__input)
18933 };
18934 let mut __struct = Self::default();
18935 __struct.fitness = buf.get_f32_le();
18936 __struct.ofs_x = buf.get_f32_le();
18937 __struct.ofs_y = buf.get_f32_le();
18938 __struct.ofs_z = buf.get_f32_le();
18939 __struct.diag_x = buf.get_f32_le();
18940 __struct.diag_y = buf.get_f32_le();
18941 __struct.diag_z = buf.get_f32_le();
18942 __struct.offdiag_x = buf.get_f32_le();
18943 __struct.offdiag_y = buf.get_f32_le();
18944 __struct.offdiag_z = buf.get_f32_le();
18945 __struct.compass_id = buf.get_u8();
18946 __struct.cal_mask = buf.get_u8();
18947 let tmp = buf.get_u8();
18948 __struct.cal_status =
18949 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18950 enum_type: "MagCalStatus",
18951 value: tmp as u32,
18952 })?;
18953 __struct.autosaved = buf.get_u8();
18954 __struct.orientation_confidence = buf.get_f32_le();
18955 let tmp = buf.get_u8();
18956 __struct.old_orientation =
18957 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18958 enum_type: "MavSensorOrientation",
18959 value: tmp as u32,
18960 })?;
18961 let tmp = buf.get_u8();
18962 __struct.new_orientation =
18963 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18964 enum_type: "MavSensorOrientation",
18965 value: tmp as u32,
18966 })?;
18967 __struct.scale_factor = buf.get_f32_le();
18968 Ok(__struct)
18969 }
18970 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18971 let mut __tmp = BytesMut::new(bytes);
18972 #[allow(clippy::absurd_extreme_comparisons)]
18973 #[allow(unused_comparisons)]
18974 if __tmp.remaining() < Self::ENCODED_LEN {
18975 panic!(
18976 "buffer is too small (need {} bytes, but got {})",
18977 Self::ENCODED_LEN,
18978 __tmp.remaining(),
18979 )
18980 }
18981 __tmp.put_f32_le(self.fitness);
18982 __tmp.put_f32_le(self.ofs_x);
18983 __tmp.put_f32_le(self.ofs_y);
18984 __tmp.put_f32_le(self.ofs_z);
18985 __tmp.put_f32_le(self.diag_x);
18986 __tmp.put_f32_le(self.diag_y);
18987 __tmp.put_f32_le(self.diag_z);
18988 __tmp.put_f32_le(self.offdiag_x);
18989 __tmp.put_f32_le(self.offdiag_y);
18990 __tmp.put_f32_le(self.offdiag_z);
18991 __tmp.put_u8(self.compass_id);
18992 __tmp.put_u8(self.cal_mask);
18993 __tmp.put_u8(self.cal_status as u8);
18994 __tmp.put_u8(self.autosaved);
18995 if matches!(version, MavlinkVersion::V2) {
18996 __tmp.put_f32_le(self.orientation_confidence);
18997 __tmp.put_u8(self.old_orientation as u8);
18998 __tmp.put_u8(self.new_orientation as u8);
18999 __tmp.put_f32_le(self.scale_factor);
19000 let len = __tmp.len();
19001 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19002 } else {
19003 __tmp.len()
19004 }
19005 }
19006}
19007#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19008#[doc = ""]
19009#[doc = "ID: 69"]
19010#[derive(Debug, Clone, PartialEq)]
19011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19013pub struct MANUAL_CONTROL_DATA {
19014 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19015 pub x: i16,
19016 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19017 pub y: i16,
19018 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19019 pub z: i16,
19020 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19021 pub r: i16,
19022 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19023 pub buttons: u16,
19024 #[doc = "The system to be controlled."]
19025 pub target: u8,
19026 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19027 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19028 pub buttons2: u16,
19029 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19030 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19031 pub enabled_extensions: u8,
19032 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19033 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19034 pub s: i16,
19035 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19036 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19037 pub t: i16,
19038 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19039 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19040 pub aux1: i16,
19041 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19042 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19043 pub aux2: i16,
19044 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19045 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19046 pub aux3: i16,
19047 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19048 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19049 pub aux4: i16,
19050 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19051 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19052 pub aux5: i16,
19053 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19054 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19055 pub aux6: i16,
19056}
19057impl MANUAL_CONTROL_DATA {
19058 pub const ENCODED_LEN: usize = 30usize;
19059 pub const DEFAULT: Self = Self {
19060 x: 0_i16,
19061 y: 0_i16,
19062 z: 0_i16,
19063 r: 0_i16,
19064 buttons: 0_u16,
19065 target: 0_u8,
19066 buttons2: 0_u16,
19067 enabled_extensions: 0_u8,
19068 s: 0_i16,
19069 t: 0_i16,
19070 aux1: 0_i16,
19071 aux2: 0_i16,
19072 aux3: 0_i16,
19073 aux4: 0_i16,
19074 aux5: 0_i16,
19075 aux6: 0_i16,
19076 };
19077 #[cfg(feature = "arbitrary")]
19078 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19079 use arbitrary::{Arbitrary, Unstructured};
19080 let mut buf = [0u8; 1024];
19081 rng.fill_bytes(&mut buf);
19082 let mut unstructured = Unstructured::new(&buf);
19083 Self::arbitrary(&mut unstructured).unwrap_or_default()
19084 }
19085}
19086impl Default for MANUAL_CONTROL_DATA {
19087 fn default() -> Self {
19088 Self::DEFAULT.clone()
19089 }
19090}
19091impl MessageData for MANUAL_CONTROL_DATA {
19092 type Message = MavMessage;
19093 const ID: u32 = 69u32;
19094 const NAME: &'static str = "MANUAL_CONTROL";
19095 const EXTRA_CRC: u8 = 243u8;
19096 const ENCODED_LEN: usize = 30usize;
19097 fn deser(
19098 _version: MavlinkVersion,
19099 __input: &[u8],
19100 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19101 let avail_len = __input.len();
19102 let mut payload_buf = [0; Self::ENCODED_LEN];
19103 let mut buf = if avail_len < Self::ENCODED_LEN {
19104 payload_buf[0..avail_len].copy_from_slice(__input);
19105 Bytes::new(&payload_buf)
19106 } else {
19107 Bytes::new(__input)
19108 };
19109 let mut __struct = Self::default();
19110 __struct.x = buf.get_i16_le();
19111 __struct.y = buf.get_i16_le();
19112 __struct.z = buf.get_i16_le();
19113 __struct.r = buf.get_i16_le();
19114 __struct.buttons = buf.get_u16_le();
19115 __struct.target = buf.get_u8();
19116 __struct.buttons2 = buf.get_u16_le();
19117 __struct.enabled_extensions = buf.get_u8();
19118 __struct.s = buf.get_i16_le();
19119 __struct.t = buf.get_i16_le();
19120 __struct.aux1 = buf.get_i16_le();
19121 __struct.aux2 = buf.get_i16_le();
19122 __struct.aux3 = buf.get_i16_le();
19123 __struct.aux4 = buf.get_i16_le();
19124 __struct.aux5 = buf.get_i16_le();
19125 __struct.aux6 = buf.get_i16_le();
19126 Ok(__struct)
19127 }
19128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19129 let mut __tmp = BytesMut::new(bytes);
19130 #[allow(clippy::absurd_extreme_comparisons)]
19131 #[allow(unused_comparisons)]
19132 if __tmp.remaining() < Self::ENCODED_LEN {
19133 panic!(
19134 "buffer is too small (need {} bytes, but got {})",
19135 Self::ENCODED_LEN,
19136 __tmp.remaining(),
19137 )
19138 }
19139 __tmp.put_i16_le(self.x);
19140 __tmp.put_i16_le(self.y);
19141 __tmp.put_i16_le(self.z);
19142 __tmp.put_i16_le(self.r);
19143 __tmp.put_u16_le(self.buttons);
19144 __tmp.put_u8(self.target);
19145 if matches!(version, MavlinkVersion::V2) {
19146 __tmp.put_u16_le(self.buttons2);
19147 __tmp.put_u8(self.enabled_extensions);
19148 __tmp.put_i16_le(self.s);
19149 __tmp.put_i16_le(self.t);
19150 __tmp.put_i16_le(self.aux1);
19151 __tmp.put_i16_le(self.aux2);
19152 __tmp.put_i16_le(self.aux3);
19153 __tmp.put_i16_le(self.aux4);
19154 __tmp.put_i16_le(self.aux5);
19155 __tmp.put_i16_le(self.aux6);
19156 let len = __tmp.len();
19157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19158 } else {
19159 __tmp.len()
19160 }
19161 }
19162}
19163#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19164#[doc = ""]
19165#[doc = "ID: 81"]
19166#[derive(Debug, Clone, PartialEq)]
19167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19169pub struct MANUAL_SETPOINT_DATA {
19170 #[doc = "Timestamp (time since system boot)."]
19171 pub time_boot_ms: u32,
19172 #[doc = "Desired roll rate"]
19173 pub roll: f32,
19174 #[doc = "Desired pitch rate"]
19175 pub pitch: f32,
19176 #[doc = "Desired yaw rate"]
19177 pub yaw: f32,
19178 #[doc = "Collective thrust, normalized to 0 .. 1"]
19179 pub thrust: f32,
19180 #[doc = "Flight mode switch position, 0.. 255"]
19181 pub mode_switch: u8,
19182 #[doc = "Override mode switch position, 0.. 255"]
19183 pub manual_override_switch: u8,
19184}
19185impl MANUAL_SETPOINT_DATA {
19186 pub const ENCODED_LEN: usize = 22usize;
19187 pub const DEFAULT: Self = Self {
19188 time_boot_ms: 0_u32,
19189 roll: 0.0_f32,
19190 pitch: 0.0_f32,
19191 yaw: 0.0_f32,
19192 thrust: 0.0_f32,
19193 mode_switch: 0_u8,
19194 manual_override_switch: 0_u8,
19195 };
19196 #[cfg(feature = "arbitrary")]
19197 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19198 use arbitrary::{Arbitrary, Unstructured};
19199 let mut buf = [0u8; 1024];
19200 rng.fill_bytes(&mut buf);
19201 let mut unstructured = Unstructured::new(&buf);
19202 Self::arbitrary(&mut unstructured).unwrap_or_default()
19203 }
19204}
19205impl Default for MANUAL_SETPOINT_DATA {
19206 fn default() -> Self {
19207 Self::DEFAULT.clone()
19208 }
19209}
19210impl MessageData for MANUAL_SETPOINT_DATA {
19211 type Message = MavMessage;
19212 const ID: u32 = 81u32;
19213 const NAME: &'static str = "MANUAL_SETPOINT";
19214 const EXTRA_CRC: u8 = 106u8;
19215 const ENCODED_LEN: usize = 22usize;
19216 fn deser(
19217 _version: MavlinkVersion,
19218 __input: &[u8],
19219 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19220 let avail_len = __input.len();
19221 let mut payload_buf = [0; Self::ENCODED_LEN];
19222 let mut buf = if avail_len < Self::ENCODED_LEN {
19223 payload_buf[0..avail_len].copy_from_slice(__input);
19224 Bytes::new(&payload_buf)
19225 } else {
19226 Bytes::new(__input)
19227 };
19228 let mut __struct = Self::default();
19229 __struct.time_boot_ms = buf.get_u32_le();
19230 __struct.roll = buf.get_f32_le();
19231 __struct.pitch = buf.get_f32_le();
19232 __struct.yaw = buf.get_f32_le();
19233 __struct.thrust = buf.get_f32_le();
19234 __struct.mode_switch = buf.get_u8();
19235 __struct.manual_override_switch = buf.get_u8();
19236 Ok(__struct)
19237 }
19238 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19239 let mut __tmp = BytesMut::new(bytes);
19240 #[allow(clippy::absurd_extreme_comparisons)]
19241 #[allow(unused_comparisons)]
19242 if __tmp.remaining() < Self::ENCODED_LEN {
19243 panic!(
19244 "buffer is too small (need {} bytes, but got {})",
19245 Self::ENCODED_LEN,
19246 __tmp.remaining(),
19247 )
19248 }
19249 __tmp.put_u32_le(self.time_boot_ms);
19250 __tmp.put_f32_le(self.roll);
19251 __tmp.put_f32_le(self.pitch);
19252 __tmp.put_f32_le(self.yaw);
19253 __tmp.put_f32_le(self.thrust);
19254 __tmp.put_u8(self.mode_switch);
19255 __tmp.put_u8(self.manual_override_switch);
19256 if matches!(version, MavlinkVersion::V2) {
19257 let len = __tmp.len();
19258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19259 } else {
19260 __tmp.len()
19261 }
19262 }
19263}
19264#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19265#[doc = ""]
19266#[doc = "ID: 249"]
19267#[derive(Debug, Clone, PartialEq)]
19268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19270pub struct MEMORY_VECT_DATA {
19271 #[doc = "Starting address of the debug variables"]
19272 pub address: u16,
19273 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19274 pub ver: u8,
19275 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19276 pub mavtype: u8,
19277 #[doc = "Memory contents at specified address"]
19278 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19279 pub value: [i8; 32],
19280}
19281impl MEMORY_VECT_DATA {
19282 pub const ENCODED_LEN: usize = 36usize;
19283 pub const DEFAULT: Self = Self {
19284 address: 0_u16,
19285 ver: 0_u8,
19286 mavtype: 0_u8,
19287 value: [0_i8; 32usize],
19288 };
19289 #[cfg(feature = "arbitrary")]
19290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19291 use arbitrary::{Arbitrary, Unstructured};
19292 let mut buf = [0u8; 1024];
19293 rng.fill_bytes(&mut buf);
19294 let mut unstructured = Unstructured::new(&buf);
19295 Self::arbitrary(&mut unstructured).unwrap_or_default()
19296 }
19297}
19298impl Default for MEMORY_VECT_DATA {
19299 fn default() -> Self {
19300 Self::DEFAULT.clone()
19301 }
19302}
19303impl MessageData for MEMORY_VECT_DATA {
19304 type Message = MavMessage;
19305 const ID: u32 = 249u32;
19306 const NAME: &'static str = "MEMORY_VECT";
19307 const EXTRA_CRC: u8 = 204u8;
19308 const ENCODED_LEN: usize = 36usize;
19309 fn deser(
19310 _version: MavlinkVersion,
19311 __input: &[u8],
19312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19313 let avail_len = __input.len();
19314 let mut payload_buf = [0; Self::ENCODED_LEN];
19315 let mut buf = if avail_len < Self::ENCODED_LEN {
19316 payload_buf[0..avail_len].copy_from_slice(__input);
19317 Bytes::new(&payload_buf)
19318 } else {
19319 Bytes::new(__input)
19320 };
19321 let mut __struct = Self::default();
19322 __struct.address = buf.get_u16_le();
19323 __struct.ver = buf.get_u8();
19324 __struct.mavtype = buf.get_u8();
19325 for v in &mut __struct.value {
19326 let val = buf.get_i8();
19327 *v = val;
19328 }
19329 Ok(__struct)
19330 }
19331 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19332 let mut __tmp = BytesMut::new(bytes);
19333 #[allow(clippy::absurd_extreme_comparisons)]
19334 #[allow(unused_comparisons)]
19335 if __tmp.remaining() < Self::ENCODED_LEN {
19336 panic!(
19337 "buffer is too small (need {} bytes, but got {})",
19338 Self::ENCODED_LEN,
19339 __tmp.remaining(),
19340 )
19341 }
19342 __tmp.put_u16_le(self.address);
19343 __tmp.put_u8(self.ver);
19344 __tmp.put_u8(self.mavtype);
19345 for val in &self.value {
19346 __tmp.put_i8(*val);
19347 }
19348 if matches!(version, MavlinkVersion::V2) {
19349 let len = __tmp.len();
19350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19351 } else {
19352 __tmp.len()
19353 }
19354 }
19355}
19356#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19357#[doc = ""]
19358#[doc = "ID: 244"]
19359#[derive(Debug, Clone, PartialEq)]
19360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19362pub struct MESSAGE_INTERVAL_DATA {
19363 #[doc = "0 indicates the interval at which it is sent."]
19364 pub interval_us: i32,
19365 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19366 pub message_id: u16,
19367}
19368impl MESSAGE_INTERVAL_DATA {
19369 pub const ENCODED_LEN: usize = 6usize;
19370 pub const DEFAULT: Self = Self {
19371 interval_us: 0_i32,
19372 message_id: 0_u16,
19373 };
19374 #[cfg(feature = "arbitrary")]
19375 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19376 use arbitrary::{Arbitrary, Unstructured};
19377 let mut buf = [0u8; 1024];
19378 rng.fill_bytes(&mut buf);
19379 let mut unstructured = Unstructured::new(&buf);
19380 Self::arbitrary(&mut unstructured).unwrap_or_default()
19381 }
19382}
19383impl Default for MESSAGE_INTERVAL_DATA {
19384 fn default() -> Self {
19385 Self::DEFAULT.clone()
19386 }
19387}
19388impl MessageData for MESSAGE_INTERVAL_DATA {
19389 type Message = MavMessage;
19390 const ID: u32 = 244u32;
19391 const NAME: &'static str = "MESSAGE_INTERVAL";
19392 const EXTRA_CRC: u8 = 95u8;
19393 const ENCODED_LEN: usize = 6usize;
19394 fn deser(
19395 _version: MavlinkVersion,
19396 __input: &[u8],
19397 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19398 let avail_len = __input.len();
19399 let mut payload_buf = [0; Self::ENCODED_LEN];
19400 let mut buf = if avail_len < Self::ENCODED_LEN {
19401 payload_buf[0..avail_len].copy_from_slice(__input);
19402 Bytes::new(&payload_buf)
19403 } else {
19404 Bytes::new(__input)
19405 };
19406 let mut __struct = Self::default();
19407 __struct.interval_us = buf.get_i32_le();
19408 __struct.message_id = buf.get_u16_le();
19409 Ok(__struct)
19410 }
19411 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19412 let mut __tmp = BytesMut::new(bytes);
19413 #[allow(clippy::absurd_extreme_comparisons)]
19414 #[allow(unused_comparisons)]
19415 if __tmp.remaining() < Self::ENCODED_LEN {
19416 panic!(
19417 "buffer is too small (need {} bytes, but got {})",
19418 Self::ENCODED_LEN,
19419 __tmp.remaining(),
19420 )
19421 }
19422 __tmp.put_i32_le(self.interval_us);
19423 __tmp.put_u16_le(self.message_id);
19424 if matches!(version, MavlinkVersion::V2) {
19425 let len = __tmp.len();
19426 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19427 } else {
19428 __tmp.len()
19429 }
19430 }
19431}
19432#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19433#[doc = ""]
19434#[doc = "ID: 47"]
19435#[derive(Debug, Clone, PartialEq)]
19436#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19438pub struct MISSION_ACK_DATA {
19439 #[doc = "System ID"]
19440 pub target_system: u8,
19441 #[doc = "Component ID"]
19442 pub target_component: u8,
19443 #[doc = "Mission result."]
19444 pub mavtype: MavMissionResult,
19445 #[doc = "Mission type."]
19446 #[cfg_attr(feature = "serde", serde(default))]
19447 pub mission_type: MavMissionType,
19448 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19449 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19450 pub opaque_id: u32,
19451}
19452impl MISSION_ACK_DATA {
19453 pub const ENCODED_LEN: usize = 8usize;
19454 pub const DEFAULT: Self = Self {
19455 target_system: 0_u8,
19456 target_component: 0_u8,
19457 mavtype: MavMissionResult::DEFAULT,
19458 mission_type: MavMissionType::DEFAULT,
19459 opaque_id: 0_u32,
19460 };
19461 #[cfg(feature = "arbitrary")]
19462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19463 use arbitrary::{Arbitrary, Unstructured};
19464 let mut buf = [0u8; 1024];
19465 rng.fill_bytes(&mut buf);
19466 let mut unstructured = Unstructured::new(&buf);
19467 Self::arbitrary(&mut unstructured).unwrap_or_default()
19468 }
19469}
19470impl Default for MISSION_ACK_DATA {
19471 fn default() -> Self {
19472 Self::DEFAULT.clone()
19473 }
19474}
19475impl MessageData for MISSION_ACK_DATA {
19476 type Message = MavMessage;
19477 const ID: u32 = 47u32;
19478 const NAME: &'static str = "MISSION_ACK";
19479 const EXTRA_CRC: u8 = 153u8;
19480 const ENCODED_LEN: usize = 8usize;
19481 fn deser(
19482 _version: MavlinkVersion,
19483 __input: &[u8],
19484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19485 let avail_len = __input.len();
19486 let mut payload_buf = [0; Self::ENCODED_LEN];
19487 let mut buf = if avail_len < Self::ENCODED_LEN {
19488 payload_buf[0..avail_len].copy_from_slice(__input);
19489 Bytes::new(&payload_buf)
19490 } else {
19491 Bytes::new(__input)
19492 };
19493 let mut __struct = Self::default();
19494 __struct.target_system = buf.get_u8();
19495 __struct.target_component = buf.get_u8();
19496 let tmp = buf.get_u8();
19497 __struct.mavtype =
19498 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19499 enum_type: "MavMissionResult",
19500 value: tmp as u32,
19501 })?;
19502 let tmp = buf.get_u8();
19503 __struct.mission_type =
19504 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19505 enum_type: "MavMissionType",
19506 value: tmp as u32,
19507 })?;
19508 __struct.opaque_id = buf.get_u32_le();
19509 Ok(__struct)
19510 }
19511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19512 let mut __tmp = BytesMut::new(bytes);
19513 #[allow(clippy::absurd_extreme_comparisons)]
19514 #[allow(unused_comparisons)]
19515 if __tmp.remaining() < Self::ENCODED_LEN {
19516 panic!(
19517 "buffer is too small (need {} bytes, but got {})",
19518 Self::ENCODED_LEN,
19519 __tmp.remaining(),
19520 )
19521 }
19522 __tmp.put_u8(self.target_system);
19523 __tmp.put_u8(self.target_component);
19524 __tmp.put_u8(self.mavtype as u8);
19525 if matches!(version, MavlinkVersion::V2) {
19526 __tmp.put_u8(self.mission_type as u8);
19527 __tmp.put_u32_le(self.opaque_id);
19528 let len = __tmp.len();
19529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19530 } else {
19531 __tmp.len()
19532 }
19533 }
19534}
19535#[doc = "Delete all mission items at once."]
19536#[doc = ""]
19537#[doc = "ID: 45"]
19538#[derive(Debug, Clone, PartialEq)]
19539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19541pub struct MISSION_CLEAR_ALL_DATA {
19542 #[doc = "System ID"]
19543 pub target_system: u8,
19544 #[doc = "Component ID"]
19545 pub target_component: u8,
19546 #[doc = "Mission type."]
19547 #[cfg_attr(feature = "serde", serde(default))]
19548 pub mission_type: MavMissionType,
19549}
19550impl MISSION_CLEAR_ALL_DATA {
19551 pub const ENCODED_LEN: usize = 3usize;
19552 pub const DEFAULT: Self = Self {
19553 target_system: 0_u8,
19554 target_component: 0_u8,
19555 mission_type: MavMissionType::DEFAULT,
19556 };
19557 #[cfg(feature = "arbitrary")]
19558 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19559 use arbitrary::{Arbitrary, Unstructured};
19560 let mut buf = [0u8; 1024];
19561 rng.fill_bytes(&mut buf);
19562 let mut unstructured = Unstructured::new(&buf);
19563 Self::arbitrary(&mut unstructured).unwrap_or_default()
19564 }
19565}
19566impl Default for MISSION_CLEAR_ALL_DATA {
19567 fn default() -> Self {
19568 Self::DEFAULT.clone()
19569 }
19570}
19571impl MessageData for MISSION_CLEAR_ALL_DATA {
19572 type Message = MavMessage;
19573 const ID: u32 = 45u32;
19574 const NAME: &'static str = "MISSION_CLEAR_ALL";
19575 const EXTRA_CRC: u8 = 232u8;
19576 const ENCODED_LEN: usize = 3usize;
19577 fn deser(
19578 _version: MavlinkVersion,
19579 __input: &[u8],
19580 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19581 let avail_len = __input.len();
19582 let mut payload_buf = [0; Self::ENCODED_LEN];
19583 let mut buf = if avail_len < Self::ENCODED_LEN {
19584 payload_buf[0..avail_len].copy_from_slice(__input);
19585 Bytes::new(&payload_buf)
19586 } else {
19587 Bytes::new(__input)
19588 };
19589 let mut __struct = Self::default();
19590 __struct.target_system = buf.get_u8();
19591 __struct.target_component = buf.get_u8();
19592 let tmp = buf.get_u8();
19593 __struct.mission_type =
19594 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19595 enum_type: "MavMissionType",
19596 value: tmp as u32,
19597 })?;
19598 Ok(__struct)
19599 }
19600 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19601 let mut __tmp = BytesMut::new(bytes);
19602 #[allow(clippy::absurd_extreme_comparisons)]
19603 #[allow(unused_comparisons)]
19604 if __tmp.remaining() < Self::ENCODED_LEN {
19605 panic!(
19606 "buffer is too small (need {} bytes, but got {})",
19607 Self::ENCODED_LEN,
19608 __tmp.remaining(),
19609 )
19610 }
19611 __tmp.put_u8(self.target_system);
19612 __tmp.put_u8(self.target_component);
19613 if matches!(version, MavlinkVersion::V2) {
19614 __tmp.put_u8(self.mission_type as u8);
19615 let len = __tmp.len();
19616 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19617 } else {
19618 __tmp.len()
19619 }
19620 }
19621}
19622#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19623#[doc = ""]
19624#[doc = "ID: 44"]
19625#[derive(Debug, Clone, PartialEq)]
19626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19628pub struct MISSION_COUNT_DATA {
19629 #[doc = "Number of mission items in the sequence"]
19630 pub count: u16,
19631 #[doc = "System ID"]
19632 pub target_system: u8,
19633 #[doc = "Component ID"]
19634 pub target_component: u8,
19635 #[doc = "Mission type."]
19636 #[cfg_attr(feature = "serde", serde(default))]
19637 pub mission_type: MavMissionType,
19638 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19639 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19640 pub opaque_id: u32,
19641}
19642impl MISSION_COUNT_DATA {
19643 pub const ENCODED_LEN: usize = 9usize;
19644 pub const DEFAULT: Self = Self {
19645 count: 0_u16,
19646 target_system: 0_u8,
19647 target_component: 0_u8,
19648 mission_type: MavMissionType::DEFAULT,
19649 opaque_id: 0_u32,
19650 };
19651 #[cfg(feature = "arbitrary")]
19652 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19653 use arbitrary::{Arbitrary, Unstructured};
19654 let mut buf = [0u8; 1024];
19655 rng.fill_bytes(&mut buf);
19656 let mut unstructured = Unstructured::new(&buf);
19657 Self::arbitrary(&mut unstructured).unwrap_or_default()
19658 }
19659}
19660impl Default for MISSION_COUNT_DATA {
19661 fn default() -> Self {
19662 Self::DEFAULT.clone()
19663 }
19664}
19665impl MessageData for MISSION_COUNT_DATA {
19666 type Message = MavMessage;
19667 const ID: u32 = 44u32;
19668 const NAME: &'static str = "MISSION_COUNT";
19669 const EXTRA_CRC: u8 = 221u8;
19670 const ENCODED_LEN: usize = 9usize;
19671 fn deser(
19672 _version: MavlinkVersion,
19673 __input: &[u8],
19674 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19675 let avail_len = __input.len();
19676 let mut payload_buf = [0; Self::ENCODED_LEN];
19677 let mut buf = if avail_len < Self::ENCODED_LEN {
19678 payload_buf[0..avail_len].copy_from_slice(__input);
19679 Bytes::new(&payload_buf)
19680 } else {
19681 Bytes::new(__input)
19682 };
19683 let mut __struct = Self::default();
19684 __struct.count = buf.get_u16_le();
19685 __struct.target_system = buf.get_u8();
19686 __struct.target_component = buf.get_u8();
19687 let tmp = buf.get_u8();
19688 __struct.mission_type =
19689 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19690 enum_type: "MavMissionType",
19691 value: tmp as u32,
19692 })?;
19693 __struct.opaque_id = buf.get_u32_le();
19694 Ok(__struct)
19695 }
19696 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19697 let mut __tmp = BytesMut::new(bytes);
19698 #[allow(clippy::absurd_extreme_comparisons)]
19699 #[allow(unused_comparisons)]
19700 if __tmp.remaining() < Self::ENCODED_LEN {
19701 panic!(
19702 "buffer is too small (need {} bytes, but got {})",
19703 Self::ENCODED_LEN,
19704 __tmp.remaining(),
19705 )
19706 }
19707 __tmp.put_u16_le(self.count);
19708 __tmp.put_u8(self.target_system);
19709 __tmp.put_u8(self.target_component);
19710 if matches!(version, MavlinkVersion::V2) {
19711 __tmp.put_u8(self.mission_type as u8);
19712 __tmp.put_u32_le(self.opaque_id);
19713 let len = __tmp.len();
19714 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19715 } else {
19716 __tmp.len()
19717 }
19718 }
19719}
19720#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19721#[doc = ""]
19722#[doc = "ID: 42"]
19723#[derive(Debug, Clone, PartialEq)]
19724#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19725#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19726pub struct MISSION_CURRENT_DATA {
19727 #[doc = "Sequence"]
19728 pub seq: u16,
19729 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19730 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19731 pub total: u16,
19732 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19733 #[cfg_attr(feature = "serde", serde(default))]
19734 pub mission_state: MissionState,
19735 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19736 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19737 pub mission_mode: u8,
19738 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19739 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19740 pub mission_id: u32,
19741 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19742 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19743 pub fence_id: u32,
19744 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19745 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19746 pub rally_points_id: u32,
19747}
19748impl MISSION_CURRENT_DATA {
19749 pub const ENCODED_LEN: usize = 18usize;
19750 pub const DEFAULT: Self = Self {
19751 seq: 0_u16,
19752 total: 0_u16,
19753 mission_state: MissionState::DEFAULT,
19754 mission_mode: 0_u8,
19755 mission_id: 0_u32,
19756 fence_id: 0_u32,
19757 rally_points_id: 0_u32,
19758 };
19759 #[cfg(feature = "arbitrary")]
19760 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19761 use arbitrary::{Arbitrary, Unstructured};
19762 let mut buf = [0u8; 1024];
19763 rng.fill_bytes(&mut buf);
19764 let mut unstructured = Unstructured::new(&buf);
19765 Self::arbitrary(&mut unstructured).unwrap_or_default()
19766 }
19767}
19768impl Default for MISSION_CURRENT_DATA {
19769 fn default() -> Self {
19770 Self::DEFAULT.clone()
19771 }
19772}
19773impl MessageData for MISSION_CURRENT_DATA {
19774 type Message = MavMessage;
19775 const ID: u32 = 42u32;
19776 const NAME: &'static str = "MISSION_CURRENT";
19777 const EXTRA_CRC: u8 = 28u8;
19778 const ENCODED_LEN: usize = 18usize;
19779 fn deser(
19780 _version: MavlinkVersion,
19781 __input: &[u8],
19782 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19783 let avail_len = __input.len();
19784 let mut payload_buf = [0; Self::ENCODED_LEN];
19785 let mut buf = if avail_len < Self::ENCODED_LEN {
19786 payload_buf[0..avail_len].copy_from_slice(__input);
19787 Bytes::new(&payload_buf)
19788 } else {
19789 Bytes::new(__input)
19790 };
19791 let mut __struct = Self::default();
19792 __struct.seq = buf.get_u16_le();
19793 __struct.total = buf.get_u16_le();
19794 let tmp = buf.get_u8();
19795 __struct.mission_state =
19796 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19797 enum_type: "MissionState",
19798 value: tmp as u32,
19799 })?;
19800 __struct.mission_mode = buf.get_u8();
19801 __struct.mission_id = buf.get_u32_le();
19802 __struct.fence_id = buf.get_u32_le();
19803 __struct.rally_points_id = buf.get_u32_le();
19804 Ok(__struct)
19805 }
19806 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19807 let mut __tmp = BytesMut::new(bytes);
19808 #[allow(clippy::absurd_extreme_comparisons)]
19809 #[allow(unused_comparisons)]
19810 if __tmp.remaining() < Self::ENCODED_LEN {
19811 panic!(
19812 "buffer is too small (need {} bytes, but got {})",
19813 Self::ENCODED_LEN,
19814 __tmp.remaining(),
19815 )
19816 }
19817 __tmp.put_u16_le(self.seq);
19818 if matches!(version, MavlinkVersion::V2) {
19819 __tmp.put_u16_le(self.total);
19820 __tmp.put_u8(self.mission_state as u8);
19821 __tmp.put_u8(self.mission_mode);
19822 __tmp.put_u32_le(self.mission_id);
19823 __tmp.put_u32_le(self.fence_id);
19824 __tmp.put_u32_le(self.rally_points_id);
19825 let len = __tmp.len();
19826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19827 } else {
19828 __tmp.len()
19829 }
19830 }
19831}
19832#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19833#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19834#[doc = ""]
19835#[doc = "ID: 39"]
19836#[derive(Debug, Clone, PartialEq)]
19837#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19839pub struct MISSION_ITEM_DATA {
19840 #[doc = "PARAM1, see MAV_CMD enum"]
19841 pub param1: f32,
19842 #[doc = "PARAM2, see MAV_CMD enum"]
19843 pub param2: f32,
19844 #[doc = "PARAM3, see MAV_CMD enum"]
19845 pub param3: f32,
19846 #[doc = "PARAM4, see MAV_CMD enum"]
19847 pub param4: f32,
19848 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19849 pub x: f32,
19850 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19851 pub y: f32,
19852 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19853 pub z: f32,
19854 #[doc = "Sequence"]
19855 pub seq: u16,
19856 #[doc = "The scheduled action for the waypoint."]
19857 pub command: MavCmd,
19858 #[doc = "System ID"]
19859 pub target_system: u8,
19860 #[doc = "Component ID"]
19861 pub target_component: u8,
19862 #[doc = "The coordinate system of the waypoint."]
19863 pub frame: MavFrame,
19864 #[doc = "false:0, true:1"]
19865 pub current: u8,
19866 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19867 pub autocontinue: u8,
19868 #[doc = "Mission type."]
19869 #[cfg_attr(feature = "serde", serde(default))]
19870 pub mission_type: MavMissionType,
19871}
19872impl MISSION_ITEM_DATA {
19873 pub const ENCODED_LEN: usize = 38usize;
19874 pub const DEFAULT: Self = Self {
19875 param1: 0.0_f32,
19876 param2: 0.0_f32,
19877 param3: 0.0_f32,
19878 param4: 0.0_f32,
19879 x: 0.0_f32,
19880 y: 0.0_f32,
19881 z: 0.0_f32,
19882 seq: 0_u16,
19883 command: MavCmd::DEFAULT,
19884 target_system: 0_u8,
19885 target_component: 0_u8,
19886 frame: MavFrame::DEFAULT,
19887 current: 0_u8,
19888 autocontinue: 0_u8,
19889 mission_type: MavMissionType::DEFAULT,
19890 };
19891 #[cfg(feature = "arbitrary")]
19892 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19893 use arbitrary::{Arbitrary, Unstructured};
19894 let mut buf = [0u8; 1024];
19895 rng.fill_bytes(&mut buf);
19896 let mut unstructured = Unstructured::new(&buf);
19897 Self::arbitrary(&mut unstructured).unwrap_or_default()
19898 }
19899}
19900impl Default for MISSION_ITEM_DATA {
19901 fn default() -> Self {
19902 Self::DEFAULT.clone()
19903 }
19904}
19905impl MessageData for MISSION_ITEM_DATA {
19906 type Message = MavMessage;
19907 const ID: u32 = 39u32;
19908 const NAME: &'static str = "MISSION_ITEM";
19909 const EXTRA_CRC: u8 = 254u8;
19910 const ENCODED_LEN: usize = 38usize;
19911 fn deser(
19912 _version: MavlinkVersion,
19913 __input: &[u8],
19914 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19915 let avail_len = __input.len();
19916 let mut payload_buf = [0; Self::ENCODED_LEN];
19917 let mut buf = if avail_len < Self::ENCODED_LEN {
19918 payload_buf[0..avail_len].copy_from_slice(__input);
19919 Bytes::new(&payload_buf)
19920 } else {
19921 Bytes::new(__input)
19922 };
19923 let mut __struct = Self::default();
19924 __struct.param1 = buf.get_f32_le();
19925 __struct.param2 = buf.get_f32_le();
19926 __struct.param3 = buf.get_f32_le();
19927 __struct.param4 = buf.get_f32_le();
19928 __struct.x = buf.get_f32_le();
19929 __struct.y = buf.get_f32_le();
19930 __struct.z = buf.get_f32_le();
19931 __struct.seq = buf.get_u16_le();
19932 let tmp = buf.get_u16_le();
19933 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19934 ::mavlink_core::error::ParserError::InvalidEnum {
19935 enum_type: "MavCmd",
19936 value: tmp as u32,
19937 },
19938 )?;
19939 __struct.target_system = buf.get_u8();
19940 __struct.target_component = buf.get_u8();
19941 let tmp = buf.get_u8();
19942 __struct.frame =
19943 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19944 enum_type: "MavFrame",
19945 value: tmp as u32,
19946 })?;
19947 __struct.current = buf.get_u8();
19948 __struct.autocontinue = buf.get_u8();
19949 let tmp = buf.get_u8();
19950 __struct.mission_type =
19951 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19952 enum_type: "MavMissionType",
19953 value: tmp as u32,
19954 })?;
19955 Ok(__struct)
19956 }
19957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19958 let mut __tmp = BytesMut::new(bytes);
19959 #[allow(clippy::absurd_extreme_comparisons)]
19960 #[allow(unused_comparisons)]
19961 if __tmp.remaining() < Self::ENCODED_LEN {
19962 panic!(
19963 "buffer is too small (need {} bytes, but got {})",
19964 Self::ENCODED_LEN,
19965 __tmp.remaining(),
19966 )
19967 }
19968 __tmp.put_f32_le(self.param1);
19969 __tmp.put_f32_le(self.param2);
19970 __tmp.put_f32_le(self.param3);
19971 __tmp.put_f32_le(self.param4);
19972 __tmp.put_f32_le(self.x);
19973 __tmp.put_f32_le(self.y);
19974 __tmp.put_f32_le(self.z);
19975 __tmp.put_u16_le(self.seq);
19976 __tmp.put_u16_le(self.command as u16);
19977 __tmp.put_u8(self.target_system);
19978 __tmp.put_u8(self.target_component);
19979 __tmp.put_u8(self.frame as u8);
19980 __tmp.put_u8(self.current);
19981 __tmp.put_u8(self.autocontinue);
19982 if matches!(version, MavlinkVersion::V2) {
19983 __tmp.put_u8(self.mission_type as u8);
19984 let len = __tmp.len();
19985 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19986 } else {
19987 __tmp.len()
19988 }
19989 }
19990}
19991#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19992#[doc = ""]
19993#[doc = "ID: 73"]
19994#[derive(Debug, Clone, PartialEq)]
19995#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19997pub struct MISSION_ITEM_INT_DATA {
19998 #[doc = "PARAM1, see MAV_CMD enum"]
19999 pub param1: f32,
20000 #[doc = "PARAM2, see MAV_CMD enum"]
20001 pub param2: f32,
20002 #[doc = "PARAM3, see MAV_CMD enum"]
20003 pub param3: f32,
20004 #[doc = "PARAM4, see MAV_CMD enum"]
20005 pub param4: f32,
20006 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20007 pub x: i32,
20008 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20009 pub y: i32,
20010 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20011 pub z: f32,
20012 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20013 pub seq: u16,
20014 #[doc = "The scheduled action for the waypoint."]
20015 pub command: MavCmd,
20016 #[doc = "System ID"]
20017 pub target_system: u8,
20018 #[doc = "Component ID"]
20019 pub target_component: u8,
20020 #[doc = "The coordinate system of the waypoint."]
20021 pub frame: MavFrame,
20022 #[doc = "false:0, true:1"]
20023 pub current: u8,
20024 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20025 pub autocontinue: u8,
20026 #[doc = "Mission type."]
20027 #[cfg_attr(feature = "serde", serde(default))]
20028 pub mission_type: MavMissionType,
20029}
20030impl MISSION_ITEM_INT_DATA {
20031 pub const ENCODED_LEN: usize = 38usize;
20032 pub const DEFAULT: Self = Self {
20033 param1: 0.0_f32,
20034 param2: 0.0_f32,
20035 param3: 0.0_f32,
20036 param4: 0.0_f32,
20037 x: 0_i32,
20038 y: 0_i32,
20039 z: 0.0_f32,
20040 seq: 0_u16,
20041 command: MavCmd::DEFAULT,
20042 target_system: 0_u8,
20043 target_component: 0_u8,
20044 frame: MavFrame::DEFAULT,
20045 current: 0_u8,
20046 autocontinue: 0_u8,
20047 mission_type: MavMissionType::DEFAULT,
20048 };
20049 #[cfg(feature = "arbitrary")]
20050 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20051 use arbitrary::{Arbitrary, Unstructured};
20052 let mut buf = [0u8; 1024];
20053 rng.fill_bytes(&mut buf);
20054 let mut unstructured = Unstructured::new(&buf);
20055 Self::arbitrary(&mut unstructured).unwrap_or_default()
20056 }
20057}
20058impl Default for MISSION_ITEM_INT_DATA {
20059 fn default() -> Self {
20060 Self::DEFAULT.clone()
20061 }
20062}
20063impl MessageData for MISSION_ITEM_INT_DATA {
20064 type Message = MavMessage;
20065 const ID: u32 = 73u32;
20066 const NAME: &'static str = "MISSION_ITEM_INT";
20067 const EXTRA_CRC: u8 = 38u8;
20068 const ENCODED_LEN: usize = 38usize;
20069 fn deser(
20070 _version: MavlinkVersion,
20071 __input: &[u8],
20072 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20073 let avail_len = __input.len();
20074 let mut payload_buf = [0; Self::ENCODED_LEN];
20075 let mut buf = if avail_len < Self::ENCODED_LEN {
20076 payload_buf[0..avail_len].copy_from_slice(__input);
20077 Bytes::new(&payload_buf)
20078 } else {
20079 Bytes::new(__input)
20080 };
20081 let mut __struct = Self::default();
20082 __struct.param1 = buf.get_f32_le();
20083 __struct.param2 = buf.get_f32_le();
20084 __struct.param3 = buf.get_f32_le();
20085 __struct.param4 = buf.get_f32_le();
20086 __struct.x = buf.get_i32_le();
20087 __struct.y = buf.get_i32_le();
20088 __struct.z = buf.get_f32_le();
20089 __struct.seq = buf.get_u16_le();
20090 let tmp = buf.get_u16_le();
20091 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20092 ::mavlink_core::error::ParserError::InvalidEnum {
20093 enum_type: "MavCmd",
20094 value: tmp as u32,
20095 },
20096 )?;
20097 __struct.target_system = buf.get_u8();
20098 __struct.target_component = buf.get_u8();
20099 let tmp = buf.get_u8();
20100 __struct.frame =
20101 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20102 enum_type: "MavFrame",
20103 value: tmp as u32,
20104 })?;
20105 __struct.current = buf.get_u8();
20106 __struct.autocontinue = buf.get_u8();
20107 let tmp = buf.get_u8();
20108 __struct.mission_type =
20109 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20110 enum_type: "MavMissionType",
20111 value: tmp as u32,
20112 })?;
20113 Ok(__struct)
20114 }
20115 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20116 let mut __tmp = BytesMut::new(bytes);
20117 #[allow(clippy::absurd_extreme_comparisons)]
20118 #[allow(unused_comparisons)]
20119 if __tmp.remaining() < Self::ENCODED_LEN {
20120 panic!(
20121 "buffer is too small (need {} bytes, but got {})",
20122 Self::ENCODED_LEN,
20123 __tmp.remaining(),
20124 )
20125 }
20126 __tmp.put_f32_le(self.param1);
20127 __tmp.put_f32_le(self.param2);
20128 __tmp.put_f32_le(self.param3);
20129 __tmp.put_f32_le(self.param4);
20130 __tmp.put_i32_le(self.x);
20131 __tmp.put_i32_le(self.y);
20132 __tmp.put_f32_le(self.z);
20133 __tmp.put_u16_le(self.seq);
20134 __tmp.put_u16_le(self.command as u16);
20135 __tmp.put_u8(self.target_system);
20136 __tmp.put_u8(self.target_component);
20137 __tmp.put_u8(self.frame as u8);
20138 __tmp.put_u8(self.current);
20139 __tmp.put_u8(self.autocontinue);
20140 if matches!(version, MavlinkVersion::V2) {
20141 __tmp.put_u8(self.mission_type as u8);
20142 let len = __tmp.len();
20143 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20144 } else {
20145 __tmp.len()
20146 }
20147 }
20148}
20149#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20150#[doc = ""]
20151#[doc = "ID: 46"]
20152#[derive(Debug, Clone, PartialEq)]
20153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20155pub struct MISSION_ITEM_REACHED_DATA {
20156 #[doc = "Sequence"]
20157 pub seq: u16,
20158}
20159impl MISSION_ITEM_REACHED_DATA {
20160 pub const ENCODED_LEN: usize = 2usize;
20161 pub const DEFAULT: Self = Self { seq: 0_u16 };
20162 #[cfg(feature = "arbitrary")]
20163 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20164 use arbitrary::{Arbitrary, Unstructured};
20165 let mut buf = [0u8; 1024];
20166 rng.fill_bytes(&mut buf);
20167 let mut unstructured = Unstructured::new(&buf);
20168 Self::arbitrary(&mut unstructured).unwrap_or_default()
20169 }
20170}
20171impl Default for MISSION_ITEM_REACHED_DATA {
20172 fn default() -> Self {
20173 Self::DEFAULT.clone()
20174 }
20175}
20176impl MessageData for MISSION_ITEM_REACHED_DATA {
20177 type Message = MavMessage;
20178 const ID: u32 = 46u32;
20179 const NAME: &'static str = "MISSION_ITEM_REACHED";
20180 const EXTRA_CRC: u8 = 11u8;
20181 const ENCODED_LEN: usize = 2usize;
20182 fn deser(
20183 _version: MavlinkVersion,
20184 __input: &[u8],
20185 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20186 let avail_len = __input.len();
20187 let mut payload_buf = [0; Self::ENCODED_LEN];
20188 let mut buf = if avail_len < Self::ENCODED_LEN {
20189 payload_buf[0..avail_len].copy_from_slice(__input);
20190 Bytes::new(&payload_buf)
20191 } else {
20192 Bytes::new(__input)
20193 };
20194 let mut __struct = Self::default();
20195 __struct.seq = buf.get_u16_le();
20196 Ok(__struct)
20197 }
20198 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20199 let mut __tmp = BytesMut::new(bytes);
20200 #[allow(clippy::absurd_extreme_comparisons)]
20201 #[allow(unused_comparisons)]
20202 if __tmp.remaining() < Self::ENCODED_LEN {
20203 panic!(
20204 "buffer is too small (need {} bytes, but got {})",
20205 Self::ENCODED_LEN,
20206 __tmp.remaining(),
20207 )
20208 }
20209 __tmp.put_u16_le(self.seq);
20210 if matches!(version, MavlinkVersion::V2) {
20211 let len = __tmp.len();
20212 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20213 } else {
20214 __tmp.len()
20215 }
20216 }
20217}
20218#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20219#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20220#[doc = ""]
20221#[doc = "ID: 40"]
20222#[derive(Debug, Clone, PartialEq)]
20223#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20224#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20225pub struct MISSION_REQUEST_DATA {
20226 #[doc = "Sequence"]
20227 pub seq: u16,
20228 #[doc = "System ID"]
20229 pub target_system: u8,
20230 #[doc = "Component ID"]
20231 pub target_component: u8,
20232 #[doc = "Mission type."]
20233 #[cfg_attr(feature = "serde", serde(default))]
20234 pub mission_type: MavMissionType,
20235}
20236impl MISSION_REQUEST_DATA {
20237 pub const ENCODED_LEN: usize = 5usize;
20238 pub const DEFAULT: Self = Self {
20239 seq: 0_u16,
20240 target_system: 0_u8,
20241 target_component: 0_u8,
20242 mission_type: MavMissionType::DEFAULT,
20243 };
20244 #[cfg(feature = "arbitrary")]
20245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20246 use arbitrary::{Arbitrary, Unstructured};
20247 let mut buf = [0u8; 1024];
20248 rng.fill_bytes(&mut buf);
20249 let mut unstructured = Unstructured::new(&buf);
20250 Self::arbitrary(&mut unstructured).unwrap_or_default()
20251 }
20252}
20253impl Default for MISSION_REQUEST_DATA {
20254 fn default() -> Self {
20255 Self::DEFAULT.clone()
20256 }
20257}
20258impl MessageData for MISSION_REQUEST_DATA {
20259 type Message = MavMessage;
20260 const ID: u32 = 40u32;
20261 const NAME: &'static str = "MISSION_REQUEST";
20262 const EXTRA_CRC: u8 = 230u8;
20263 const ENCODED_LEN: usize = 5usize;
20264 fn deser(
20265 _version: MavlinkVersion,
20266 __input: &[u8],
20267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20268 let avail_len = __input.len();
20269 let mut payload_buf = [0; Self::ENCODED_LEN];
20270 let mut buf = if avail_len < Self::ENCODED_LEN {
20271 payload_buf[0..avail_len].copy_from_slice(__input);
20272 Bytes::new(&payload_buf)
20273 } else {
20274 Bytes::new(__input)
20275 };
20276 let mut __struct = Self::default();
20277 __struct.seq = buf.get_u16_le();
20278 __struct.target_system = buf.get_u8();
20279 __struct.target_component = buf.get_u8();
20280 let tmp = buf.get_u8();
20281 __struct.mission_type =
20282 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20283 enum_type: "MavMissionType",
20284 value: tmp as u32,
20285 })?;
20286 Ok(__struct)
20287 }
20288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20289 let mut __tmp = BytesMut::new(bytes);
20290 #[allow(clippy::absurd_extreme_comparisons)]
20291 #[allow(unused_comparisons)]
20292 if __tmp.remaining() < Self::ENCODED_LEN {
20293 panic!(
20294 "buffer is too small (need {} bytes, but got {})",
20295 Self::ENCODED_LEN,
20296 __tmp.remaining(),
20297 )
20298 }
20299 __tmp.put_u16_le(self.seq);
20300 __tmp.put_u8(self.target_system);
20301 __tmp.put_u8(self.target_component);
20302 if matches!(version, MavlinkVersion::V2) {
20303 __tmp.put_u8(self.mission_type as u8);
20304 let len = __tmp.len();
20305 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20306 } else {
20307 __tmp.len()
20308 }
20309 }
20310}
20311#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20312#[doc = ""]
20313#[doc = "ID: 51"]
20314#[derive(Debug, Clone, PartialEq)]
20315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20317pub struct MISSION_REQUEST_INT_DATA {
20318 #[doc = "Sequence"]
20319 pub seq: u16,
20320 #[doc = "System ID"]
20321 pub target_system: u8,
20322 #[doc = "Component ID"]
20323 pub target_component: u8,
20324 #[doc = "Mission type."]
20325 #[cfg_attr(feature = "serde", serde(default))]
20326 pub mission_type: MavMissionType,
20327}
20328impl MISSION_REQUEST_INT_DATA {
20329 pub const ENCODED_LEN: usize = 5usize;
20330 pub const DEFAULT: Self = Self {
20331 seq: 0_u16,
20332 target_system: 0_u8,
20333 target_component: 0_u8,
20334 mission_type: MavMissionType::DEFAULT,
20335 };
20336 #[cfg(feature = "arbitrary")]
20337 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20338 use arbitrary::{Arbitrary, Unstructured};
20339 let mut buf = [0u8; 1024];
20340 rng.fill_bytes(&mut buf);
20341 let mut unstructured = Unstructured::new(&buf);
20342 Self::arbitrary(&mut unstructured).unwrap_or_default()
20343 }
20344}
20345impl Default for MISSION_REQUEST_INT_DATA {
20346 fn default() -> Self {
20347 Self::DEFAULT.clone()
20348 }
20349}
20350impl MessageData for MISSION_REQUEST_INT_DATA {
20351 type Message = MavMessage;
20352 const ID: u32 = 51u32;
20353 const NAME: &'static str = "MISSION_REQUEST_INT";
20354 const EXTRA_CRC: u8 = 196u8;
20355 const ENCODED_LEN: usize = 5usize;
20356 fn deser(
20357 _version: MavlinkVersion,
20358 __input: &[u8],
20359 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20360 let avail_len = __input.len();
20361 let mut payload_buf = [0; Self::ENCODED_LEN];
20362 let mut buf = if avail_len < Self::ENCODED_LEN {
20363 payload_buf[0..avail_len].copy_from_slice(__input);
20364 Bytes::new(&payload_buf)
20365 } else {
20366 Bytes::new(__input)
20367 };
20368 let mut __struct = Self::default();
20369 __struct.seq = buf.get_u16_le();
20370 __struct.target_system = buf.get_u8();
20371 __struct.target_component = buf.get_u8();
20372 let tmp = buf.get_u8();
20373 __struct.mission_type =
20374 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20375 enum_type: "MavMissionType",
20376 value: tmp as u32,
20377 })?;
20378 Ok(__struct)
20379 }
20380 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20381 let mut __tmp = BytesMut::new(bytes);
20382 #[allow(clippy::absurd_extreme_comparisons)]
20383 #[allow(unused_comparisons)]
20384 if __tmp.remaining() < Self::ENCODED_LEN {
20385 panic!(
20386 "buffer is too small (need {} bytes, but got {})",
20387 Self::ENCODED_LEN,
20388 __tmp.remaining(),
20389 )
20390 }
20391 __tmp.put_u16_le(self.seq);
20392 __tmp.put_u8(self.target_system);
20393 __tmp.put_u8(self.target_component);
20394 if matches!(version, MavlinkVersion::V2) {
20395 __tmp.put_u8(self.mission_type as u8);
20396 let len = __tmp.len();
20397 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20398 } else {
20399 __tmp.len()
20400 }
20401 }
20402}
20403#[doc = "Request the overall list of mission items from the system/component."]
20404#[doc = ""]
20405#[doc = "ID: 43"]
20406#[derive(Debug, Clone, PartialEq)]
20407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20409pub struct MISSION_REQUEST_LIST_DATA {
20410 #[doc = "System ID"]
20411 pub target_system: u8,
20412 #[doc = "Component ID"]
20413 pub target_component: u8,
20414 #[doc = "Mission type."]
20415 #[cfg_attr(feature = "serde", serde(default))]
20416 pub mission_type: MavMissionType,
20417}
20418impl MISSION_REQUEST_LIST_DATA {
20419 pub const ENCODED_LEN: usize = 3usize;
20420 pub const DEFAULT: Self = Self {
20421 target_system: 0_u8,
20422 target_component: 0_u8,
20423 mission_type: MavMissionType::DEFAULT,
20424 };
20425 #[cfg(feature = "arbitrary")]
20426 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20427 use arbitrary::{Arbitrary, Unstructured};
20428 let mut buf = [0u8; 1024];
20429 rng.fill_bytes(&mut buf);
20430 let mut unstructured = Unstructured::new(&buf);
20431 Self::arbitrary(&mut unstructured).unwrap_or_default()
20432 }
20433}
20434impl Default for MISSION_REQUEST_LIST_DATA {
20435 fn default() -> Self {
20436 Self::DEFAULT.clone()
20437 }
20438}
20439impl MessageData for MISSION_REQUEST_LIST_DATA {
20440 type Message = MavMessage;
20441 const ID: u32 = 43u32;
20442 const NAME: &'static str = "MISSION_REQUEST_LIST";
20443 const EXTRA_CRC: u8 = 132u8;
20444 const ENCODED_LEN: usize = 3usize;
20445 fn deser(
20446 _version: MavlinkVersion,
20447 __input: &[u8],
20448 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20449 let avail_len = __input.len();
20450 let mut payload_buf = [0; Self::ENCODED_LEN];
20451 let mut buf = if avail_len < Self::ENCODED_LEN {
20452 payload_buf[0..avail_len].copy_from_slice(__input);
20453 Bytes::new(&payload_buf)
20454 } else {
20455 Bytes::new(__input)
20456 };
20457 let mut __struct = Self::default();
20458 __struct.target_system = buf.get_u8();
20459 __struct.target_component = buf.get_u8();
20460 let tmp = buf.get_u8();
20461 __struct.mission_type =
20462 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20463 enum_type: "MavMissionType",
20464 value: tmp as u32,
20465 })?;
20466 Ok(__struct)
20467 }
20468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20469 let mut __tmp = BytesMut::new(bytes);
20470 #[allow(clippy::absurd_extreme_comparisons)]
20471 #[allow(unused_comparisons)]
20472 if __tmp.remaining() < Self::ENCODED_LEN {
20473 panic!(
20474 "buffer is too small (need {} bytes, but got {})",
20475 Self::ENCODED_LEN,
20476 __tmp.remaining(),
20477 )
20478 }
20479 __tmp.put_u8(self.target_system);
20480 __tmp.put_u8(self.target_component);
20481 if matches!(version, MavlinkVersion::V2) {
20482 __tmp.put_u8(self.mission_type as u8);
20483 let len = __tmp.len();
20484 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20485 } else {
20486 __tmp.len()
20487 }
20488 }
20489}
20490#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20491#[doc = ""]
20492#[doc = "ID: 37"]
20493#[derive(Debug, Clone, PartialEq)]
20494#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20495#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20496pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20497 #[doc = "Start index"]
20498 pub start_index: i16,
20499 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20500 pub end_index: i16,
20501 #[doc = "System ID"]
20502 pub target_system: u8,
20503 #[doc = "Component ID"]
20504 pub target_component: u8,
20505 #[doc = "Mission type."]
20506 #[cfg_attr(feature = "serde", serde(default))]
20507 pub mission_type: MavMissionType,
20508}
20509impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20510 pub const ENCODED_LEN: usize = 7usize;
20511 pub const DEFAULT: Self = Self {
20512 start_index: 0_i16,
20513 end_index: 0_i16,
20514 target_system: 0_u8,
20515 target_component: 0_u8,
20516 mission_type: MavMissionType::DEFAULT,
20517 };
20518 #[cfg(feature = "arbitrary")]
20519 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20520 use arbitrary::{Arbitrary, Unstructured};
20521 let mut buf = [0u8; 1024];
20522 rng.fill_bytes(&mut buf);
20523 let mut unstructured = Unstructured::new(&buf);
20524 Self::arbitrary(&mut unstructured).unwrap_or_default()
20525 }
20526}
20527impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20528 fn default() -> Self {
20529 Self::DEFAULT.clone()
20530 }
20531}
20532impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20533 type Message = MavMessage;
20534 const ID: u32 = 37u32;
20535 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20536 const EXTRA_CRC: u8 = 212u8;
20537 const ENCODED_LEN: usize = 7usize;
20538 fn deser(
20539 _version: MavlinkVersion,
20540 __input: &[u8],
20541 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20542 let avail_len = __input.len();
20543 let mut payload_buf = [0; Self::ENCODED_LEN];
20544 let mut buf = if avail_len < Self::ENCODED_LEN {
20545 payload_buf[0..avail_len].copy_from_slice(__input);
20546 Bytes::new(&payload_buf)
20547 } else {
20548 Bytes::new(__input)
20549 };
20550 let mut __struct = Self::default();
20551 __struct.start_index = buf.get_i16_le();
20552 __struct.end_index = buf.get_i16_le();
20553 __struct.target_system = buf.get_u8();
20554 __struct.target_component = buf.get_u8();
20555 let tmp = buf.get_u8();
20556 __struct.mission_type =
20557 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20558 enum_type: "MavMissionType",
20559 value: tmp as u32,
20560 })?;
20561 Ok(__struct)
20562 }
20563 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20564 let mut __tmp = BytesMut::new(bytes);
20565 #[allow(clippy::absurd_extreme_comparisons)]
20566 #[allow(unused_comparisons)]
20567 if __tmp.remaining() < Self::ENCODED_LEN {
20568 panic!(
20569 "buffer is too small (need {} bytes, but got {})",
20570 Self::ENCODED_LEN,
20571 __tmp.remaining(),
20572 )
20573 }
20574 __tmp.put_i16_le(self.start_index);
20575 __tmp.put_i16_le(self.end_index);
20576 __tmp.put_u8(self.target_system);
20577 __tmp.put_u8(self.target_component);
20578 if matches!(version, MavlinkVersion::V2) {
20579 __tmp.put_u8(self.mission_type as u8);
20580 let len = __tmp.len();
20581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20582 } else {
20583 __tmp.len()
20584 }
20585 }
20586}
20587#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20588#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20589#[doc = ""]
20590#[doc = "ID: 41"]
20591#[derive(Debug, Clone, PartialEq)]
20592#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20593#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20594pub struct MISSION_SET_CURRENT_DATA {
20595 #[doc = "Sequence"]
20596 pub seq: u16,
20597 #[doc = "System ID"]
20598 pub target_system: u8,
20599 #[doc = "Component ID"]
20600 pub target_component: u8,
20601}
20602impl MISSION_SET_CURRENT_DATA {
20603 pub const ENCODED_LEN: usize = 4usize;
20604 pub const DEFAULT: Self = Self {
20605 seq: 0_u16,
20606 target_system: 0_u8,
20607 target_component: 0_u8,
20608 };
20609 #[cfg(feature = "arbitrary")]
20610 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20611 use arbitrary::{Arbitrary, Unstructured};
20612 let mut buf = [0u8; 1024];
20613 rng.fill_bytes(&mut buf);
20614 let mut unstructured = Unstructured::new(&buf);
20615 Self::arbitrary(&mut unstructured).unwrap_or_default()
20616 }
20617}
20618impl Default for MISSION_SET_CURRENT_DATA {
20619 fn default() -> Self {
20620 Self::DEFAULT.clone()
20621 }
20622}
20623impl MessageData for MISSION_SET_CURRENT_DATA {
20624 type Message = MavMessage;
20625 const ID: u32 = 41u32;
20626 const NAME: &'static str = "MISSION_SET_CURRENT";
20627 const EXTRA_CRC: u8 = 28u8;
20628 const ENCODED_LEN: usize = 4usize;
20629 fn deser(
20630 _version: MavlinkVersion,
20631 __input: &[u8],
20632 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20633 let avail_len = __input.len();
20634 let mut payload_buf = [0; Self::ENCODED_LEN];
20635 let mut buf = if avail_len < Self::ENCODED_LEN {
20636 payload_buf[0..avail_len].copy_from_slice(__input);
20637 Bytes::new(&payload_buf)
20638 } else {
20639 Bytes::new(__input)
20640 };
20641 let mut __struct = Self::default();
20642 __struct.seq = buf.get_u16_le();
20643 __struct.target_system = buf.get_u8();
20644 __struct.target_component = buf.get_u8();
20645 Ok(__struct)
20646 }
20647 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20648 let mut __tmp = BytesMut::new(bytes);
20649 #[allow(clippy::absurd_extreme_comparisons)]
20650 #[allow(unused_comparisons)]
20651 if __tmp.remaining() < Self::ENCODED_LEN {
20652 panic!(
20653 "buffer is too small (need {} bytes, but got {})",
20654 Self::ENCODED_LEN,
20655 __tmp.remaining(),
20656 )
20657 }
20658 __tmp.put_u16_le(self.seq);
20659 __tmp.put_u8(self.target_system);
20660 __tmp.put_u8(self.target_component);
20661 if matches!(version, MavlinkVersion::V2) {
20662 let len = __tmp.len();
20663 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20664 } else {
20665 __tmp.len()
20666 }
20667 }
20668}
20669#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20670#[doc = ""]
20671#[doc = "ID: 38"]
20672#[derive(Debug, Clone, PartialEq)]
20673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20675pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20676 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20677 pub start_index: i16,
20678 #[doc = "End index, equal or greater than start index."]
20679 pub end_index: i16,
20680 #[doc = "System ID"]
20681 pub target_system: u8,
20682 #[doc = "Component ID"]
20683 pub target_component: u8,
20684 #[doc = "Mission type."]
20685 #[cfg_attr(feature = "serde", serde(default))]
20686 pub mission_type: MavMissionType,
20687}
20688impl MISSION_WRITE_PARTIAL_LIST_DATA {
20689 pub const ENCODED_LEN: usize = 7usize;
20690 pub const DEFAULT: Self = Self {
20691 start_index: 0_i16,
20692 end_index: 0_i16,
20693 target_system: 0_u8,
20694 target_component: 0_u8,
20695 mission_type: MavMissionType::DEFAULT,
20696 };
20697 #[cfg(feature = "arbitrary")]
20698 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20699 use arbitrary::{Arbitrary, Unstructured};
20700 let mut buf = [0u8; 1024];
20701 rng.fill_bytes(&mut buf);
20702 let mut unstructured = Unstructured::new(&buf);
20703 Self::arbitrary(&mut unstructured).unwrap_or_default()
20704 }
20705}
20706impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20707 fn default() -> Self {
20708 Self::DEFAULT.clone()
20709 }
20710}
20711impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20712 type Message = MavMessage;
20713 const ID: u32 = 38u32;
20714 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20715 const EXTRA_CRC: u8 = 9u8;
20716 const ENCODED_LEN: usize = 7usize;
20717 fn deser(
20718 _version: MavlinkVersion,
20719 __input: &[u8],
20720 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20721 let avail_len = __input.len();
20722 let mut payload_buf = [0; Self::ENCODED_LEN];
20723 let mut buf = if avail_len < Self::ENCODED_LEN {
20724 payload_buf[0..avail_len].copy_from_slice(__input);
20725 Bytes::new(&payload_buf)
20726 } else {
20727 Bytes::new(__input)
20728 };
20729 let mut __struct = Self::default();
20730 __struct.start_index = buf.get_i16_le();
20731 __struct.end_index = buf.get_i16_le();
20732 __struct.target_system = buf.get_u8();
20733 __struct.target_component = buf.get_u8();
20734 let tmp = buf.get_u8();
20735 __struct.mission_type =
20736 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20737 enum_type: "MavMissionType",
20738 value: tmp as u32,
20739 })?;
20740 Ok(__struct)
20741 }
20742 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20743 let mut __tmp = BytesMut::new(bytes);
20744 #[allow(clippy::absurd_extreme_comparisons)]
20745 #[allow(unused_comparisons)]
20746 if __tmp.remaining() < Self::ENCODED_LEN {
20747 panic!(
20748 "buffer is too small (need {} bytes, but got {})",
20749 Self::ENCODED_LEN,
20750 __tmp.remaining(),
20751 )
20752 }
20753 __tmp.put_i16_le(self.start_index);
20754 __tmp.put_i16_le(self.end_index);
20755 __tmp.put_u8(self.target_system);
20756 __tmp.put_u8(self.target_component);
20757 if matches!(version, MavlinkVersion::V2) {
20758 __tmp.put_u8(self.mission_type as u8);
20759 let len = __tmp.len();
20760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20761 } else {
20762 __tmp.len()
20763 }
20764 }
20765}
20766#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20767#[doc = "Orientation of a mount."]
20768#[doc = ""]
20769#[doc = "ID: 265"]
20770#[derive(Debug, Clone, PartialEq)]
20771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20773pub struct MOUNT_ORIENTATION_DATA {
20774 #[doc = "Timestamp (time since system boot)."]
20775 pub time_boot_ms: u32,
20776 #[doc = "Roll in global frame (set to NaN for invalid)."]
20777 pub roll: f32,
20778 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20779 pub pitch: f32,
20780 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20781 pub yaw: f32,
20782 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20783 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20784 pub yaw_absolute: f32,
20785}
20786impl MOUNT_ORIENTATION_DATA {
20787 pub const ENCODED_LEN: usize = 20usize;
20788 pub const DEFAULT: Self = Self {
20789 time_boot_ms: 0_u32,
20790 roll: 0.0_f32,
20791 pitch: 0.0_f32,
20792 yaw: 0.0_f32,
20793 yaw_absolute: 0.0_f32,
20794 };
20795 #[cfg(feature = "arbitrary")]
20796 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20797 use arbitrary::{Arbitrary, Unstructured};
20798 let mut buf = [0u8; 1024];
20799 rng.fill_bytes(&mut buf);
20800 let mut unstructured = Unstructured::new(&buf);
20801 Self::arbitrary(&mut unstructured).unwrap_or_default()
20802 }
20803}
20804impl Default for MOUNT_ORIENTATION_DATA {
20805 fn default() -> Self {
20806 Self::DEFAULT.clone()
20807 }
20808}
20809impl MessageData for MOUNT_ORIENTATION_DATA {
20810 type Message = MavMessage;
20811 const ID: u32 = 265u32;
20812 const NAME: &'static str = "MOUNT_ORIENTATION";
20813 const EXTRA_CRC: u8 = 26u8;
20814 const ENCODED_LEN: usize = 20usize;
20815 fn deser(
20816 _version: MavlinkVersion,
20817 __input: &[u8],
20818 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20819 let avail_len = __input.len();
20820 let mut payload_buf = [0; Self::ENCODED_LEN];
20821 let mut buf = if avail_len < Self::ENCODED_LEN {
20822 payload_buf[0..avail_len].copy_from_slice(__input);
20823 Bytes::new(&payload_buf)
20824 } else {
20825 Bytes::new(__input)
20826 };
20827 let mut __struct = Self::default();
20828 __struct.time_boot_ms = buf.get_u32_le();
20829 __struct.roll = buf.get_f32_le();
20830 __struct.pitch = buf.get_f32_le();
20831 __struct.yaw = buf.get_f32_le();
20832 __struct.yaw_absolute = buf.get_f32_le();
20833 Ok(__struct)
20834 }
20835 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20836 let mut __tmp = BytesMut::new(bytes);
20837 #[allow(clippy::absurd_extreme_comparisons)]
20838 #[allow(unused_comparisons)]
20839 if __tmp.remaining() < Self::ENCODED_LEN {
20840 panic!(
20841 "buffer is too small (need {} bytes, but got {})",
20842 Self::ENCODED_LEN,
20843 __tmp.remaining(),
20844 )
20845 }
20846 __tmp.put_u32_le(self.time_boot_ms);
20847 __tmp.put_f32_le(self.roll);
20848 __tmp.put_f32_le(self.pitch);
20849 __tmp.put_f32_le(self.yaw);
20850 if matches!(version, MavlinkVersion::V2) {
20851 __tmp.put_f32_le(self.yaw_absolute);
20852 let len = __tmp.len();
20853 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20854 } else {
20855 __tmp.len()
20856 }
20857 }
20858}
20859#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20860#[doc = ""]
20861#[doc = "ID: 251"]
20862#[derive(Debug, Clone, PartialEq)]
20863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20865pub struct NAMED_VALUE_FLOAT_DATA {
20866 #[doc = "Timestamp (time since system boot)."]
20867 pub time_boot_ms: u32,
20868 #[doc = "Floating point value"]
20869 pub value: f32,
20870 #[doc = "Name of the debug variable"]
20871 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20872 pub name: [u8; 10],
20873}
20874impl NAMED_VALUE_FLOAT_DATA {
20875 pub const ENCODED_LEN: usize = 18usize;
20876 pub const DEFAULT: Self = Self {
20877 time_boot_ms: 0_u32,
20878 value: 0.0_f32,
20879 name: [0_u8; 10usize],
20880 };
20881 #[cfg(feature = "arbitrary")]
20882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20883 use arbitrary::{Arbitrary, Unstructured};
20884 let mut buf = [0u8; 1024];
20885 rng.fill_bytes(&mut buf);
20886 let mut unstructured = Unstructured::new(&buf);
20887 Self::arbitrary(&mut unstructured).unwrap_or_default()
20888 }
20889}
20890impl Default for NAMED_VALUE_FLOAT_DATA {
20891 fn default() -> Self {
20892 Self::DEFAULT.clone()
20893 }
20894}
20895impl MessageData for NAMED_VALUE_FLOAT_DATA {
20896 type Message = MavMessage;
20897 const ID: u32 = 251u32;
20898 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20899 const EXTRA_CRC: u8 = 170u8;
20900 const ENCODED_LEN: usize = 18usize;
20901 fn deser(
20902 _version: MavlinkVersion,
20903 __input: &[u8],
20904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20905 let avail_len = __input.len();
20906 let mut payload_buf = [0; Self::ENCODED_LEN];
20907 let mut buf = if avail_len < Self::ENCODED_LEN {
20908 payload_buf[0..avail_len].copy_from_slice(__input);
20909 Bytes::new(&payload_buf)
20910 } else {
20911 Bytes::new(__input)
20912 };
20913 let mut __struct = Self::default();
20914 __struct.time_boot_ms = buf.get_u32_le();
20915 __struct.value = buf.get_f32_le();
20916 for v in &mut __struct.name {
20917 let val = buf.get_u8();
20918 *v = val;
20919 }
20920 Ok(__struct)
20921 }
20922 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20923 let mut __tmp = BytesMut::new(bytes);
20924 #[allow(clippy::absurd_extreme_comparisons)]
20925 #[allow(unused_comparisons)]
20926 if __tmp.remaining() < Self::ENCODED_LEN {
20927 panic!(
20928 "buffer is too small (need {} bytes, but got {})",
20929 Self::ENCODED_LEN,
20930 __tmp.remaining(),
20931 )
20932 }
20933 __tmp.put_u32_le(self.time_boot_ms);
20934 __tmp.put_f32_le(self.value);
20935 for val in &self.name {
20936 __tmp.put_u8(*val);
20937 }
20938 if matches!(version, MavlinkVersion::V2) {
20939 let len = __tmp.len();
20940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20941 } else {
20942 __tmp.len()
20943 }
20944 }
20945}
20946#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20947#[doc = ""]
20948#[doc = "ID: 252"]
20949#[derive(Debug, Clone, PartialEq)]
20950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20952pub struct NAMED_VALUE_INT_DATA {
20953 #[doc = "Timestamp (time since system boot)."]
20954 pub time_boot_ms: u32,
20955 #[doc = "Signed integer value"]
20956 pub value: i32,
20957 #[doc = "Name of the debug variable"]
20958 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20959 pub name: [u8; 10],
20960}
20961impl NAMED_VALUE_INT_DATA {
20962 pub const ENCODED_LEN: usize = 18usize;
20963 pub const DEFAULT: Self = Self {
20964 time_boot_ms: 0_u32,
20965 value: 0_i32,
20966 name: [0_u8; 10usize],
20967 };
20968 #[cfg(feature = "arbitrary")]
20969 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20970 use arbitrary::{Arbitrary, Unstructured};
20971 let mut buf = [0u8; 1024];
20972 rng.fill_bytes(&mut buf);
20973 let mut unstructured = Unstructured::new(&buf);
20974 Self::arbitrary(&mut unstructured).unwrap_or_default()
20975 }
20976}
20977impl Default for NAMED_VALUE_INT_DATA {
20978 fn default() -> Self {
20979 Self::DEFAULT.clone()
20980 }
20981}
20982impl MessageData for NAMED_VALUE_INT_DATA {
20983 type Message = MavMessage;
20984 const ID: u32 = 252u32;
20985 const NAME: &'static str = "NAMED_VALUE_INT";
20986 const EXTRA_CRC: u8 = 44u8;
20987 const ENCODED_LEN: usize = 18usize;
20988 fn deser(
20989 _version: MavlinkVersion,
20990 __input: &[u8],
20991 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20992 let avail_len = __input.len();
20993 let mut payload_buf = [0; Self::ENCODED_LEN];
20994 let mut buf = if avail_len < Self::ENCODED_LEN {
20995 payload_buf[0..avail_len].copy_from_slice(__input);
20996 Bytes::new(&payload_buf)
20997 } else {
20998 Bytes::new(__input)
20999 };
21000 let mut __struct = Self::default();
21001 __struct.time_boot_ms = buf.get_u32_le();
21002 __struct.value = buf.get_i32_le();
21003 for v in &mut __struct.name {
21004 let val = buf.get_u8();
21005 *v = val;
21006 }
21007 Ok(__struct)
21008 }
21009 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21010 let mut __tmp = BytesMut::new(bytes);
21011 #[allow(clippy::absurd_extreme_comparisons)]
21012 #[allow(unused_comparisons)]
21013 if __tmp.remaining() < Self::ENCODED_LEN {
21014 panic!(
21015 "buffer is too small (need {} bytes, but got {})",
21016 Self::ENCODED_LEN,
21017 __tmp.remaining(),
21018 )
21019 }
21020 __tmp.put_u32_le(self.time_boot_ms);
21021 __tmp.put_i32_le(self.value);
21022 for val in &self.name {
21023 __tmp.put_u8(*val);
21024 }
21025 if matches!(version, MavlinkVersion::V2) {
21026 let len = __tmp.len();
21027 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21028 } else {
21029 __tmp.len()
21030 }
21031 }
21032}
21033#[doc = "The state of the navigation and position controller."]
21034#[doc = ""]
21035#[doc = "ID: 62"]
21036#[derive(Debug, Clone, PartialEq)]
21037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21038#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21039pub struct NAV_CONTROLLER_OUTPUT_DATA {
21040 #[doc = "Current desired roll"]
21041 pub nav_roll: f32,
21042 #[doc = "Current desired pitch"]
21043 pub nav_pitch: f32,
21044 #[doc = "Current altitude error"]
21045 pub alt_error: f32,
21046 #[doc = "Current airspeed error"]
21047 pub aspd_error: f32,
21048 #[doc = "Current crosstrack error on x-y plane"]
21049 pub xtrack_error: f32,
21050 #[doc = "Current desired heading"]
21051 pub nav_bearing: i16,
21052 #[doc = "Bearing to current waypoint/target"]
21053 pub target_bearing: i16,
21054 #[doc = "Distance to active waypoint"]
21055 pub wp_dist: u16,
21056}
21057impl NAV_CONTROLLER_OUTPUT_DATA {
21058 pub const ENCODED_LEN: usize = 26usize;
21059 pub const DEFAULT: Self = Self {
21060 nav_roll: 0.0_f32,
21061 nav_pitch: 0.0_f32,
21062 alt_error: 0.0_f32,
21063 aspd_error: 0.0_f32,
21064 xtrack_error: 0.0_f32,
21065 nav_bearing: 0_i16,
21066 target_bearing: 0_i16,
21067 wp_dist: 0_u16,
21068 };
21069 #[cfg(feature = "arbitrary")]
21070 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21071 use arbitrary::{Arbitrary, Unstructured};
21072 let mut buf = [0u8; 1024];
21073 rng.fill_bytes(&mut buf);
21074 let mut unstructured = Unstructured::new(&buf);
21075 Self::arbitrary(&mut unstructured).unwrap_or_default()
21076 }
21077}
21078impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21079 fn default() -> Self {
21080 Self::DEFAULT.clone()
21081 }
21082}
21083impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21084 type Message = MavMessage;
21085 const ID: u32 = 62u32;
21086 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21087 const EXTRA_CRC: u8 = 183u8;
21088 const ENCODED_LEN: usize = 26usize;
21089 fn deser(
21090 _version: MavlinkVersion,
21091 __input: &[u8],
21092 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21093 let avail_len = __input.len();
21094 let mut payload_buf = [0; Self::ENCODED_LEN];
21095 let mut buf = if avail_len < Self::ENCODED_LEN {
21096 payload_buf[0..avail_len].copy_from_slice(__input);
21097 Bytes::new(&payload_buf)
21098 } else {
21099 Bytes::new(__input)
21100 };
21101 let mut __struct = Self::default();
21102 __struct.nav_roll = buf.get_f32_le();
21103 __struct.nav_pitch = buf.get_f32_le();
21104 __struct.alt_error = buf.get_f32_le();
21105 __struct.aspd_error = buf.get_f32_le();
21106 __struct.xtrack_error = buf.get_f32_le();
21107 __struct.nav_bearing = buf.get_i16_le();
21108 __struct.target_bearing = buf.get_i16_le();
21109 __struct.wp_dist = buf.get_u16_le();
21110 Ok(__struct)
21111 }
21112 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21113 let mut __tmp = BytesMut::new(bytes);
21114 #[allow(clippy::absurd_extreme_comparisons)]
21115 #[allow(unused_comparisons)]
21116 if __tmp.remaining() < Self::ENCODED_LEN {
21117 panic!(
21118 "buffer is too small (need {} bytes, but got {})",
21119 Self::ENCODED_LEN,
21120 __tmp.remaining(),
21121 )
21122 }
21123 __tmp.put_f32_le(self.nav_roll);
21124 __tmp.put_f32_le(self.nav_pitch);
21125 __tmp.put_f32_le(self.alt_error);
21126 __tmp.put_f32_le(self.aspd_error);
21127 __tmp.put_f32_le(self.xtrack_error);
21128 __tmp.put_i16_le(self.nav_bearing);
21129 __tmp.put_i16_le(self.target_bearing);
21130 __tmp.put_u16_le(self.wp_dist);
21131 if matches!(version, MavlinkVersion::V2) {
21132 let len = __tmp.len();
21133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21134 } else {
21135 __tmp.len()
21136 }
21137 }
21138}
21139#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21140#[doc = ""]
21141#[doc = "ID: 330"]
21142#[derive(Debug, Clone, PartialEq)]
21143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21145pub struct OBSTACLE_DISTANCE_DATA {
21146 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21147 pub time_usec: u64,
21148 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21149 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21150 pub distances: [u16; 72],
21151 #[doc = "Minimum distance the sensor can measure."]
21152 pub min_distance: u16,
21153 #[doc = "Maximum distance the sensor can measure."]
21154 pub max_distance: u16,
21155 #[doc = "Class id of the distance sensor type."]
21156 pub sensor_type: MavDistanceSensor,
21157 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21158 pub increment: u8,
21159 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21160 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21161 pub increment_f: f32,
21162 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21164 pub angle_offset: f32,
21165 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21166 #[cfg_attr(feature = "serde", serde(default))]
21167 pub frame: MavFrame,
21168}
21169impl OBSTACLE_DISTANCE_DATA {
21170 pub const ENCODED_LEN: usize = 167usize;
21171 pub const DEFAULT: Self = Self {
21172 time_usec: 0_u64,
21173 distances: [0_u16; 72usize],
21174 min_distance: 0_u16,
21175 max_distance: 0_u16,
21176 sensor_type: MavDistanceSensor::DEFAULT,
21177 increment: 0_u8,
21178 increment_f: 0.0_f32,
21179 angle_offset: 0.0_f32,
21180 frame: MavFrame::DEFAULT,
21181 };
21182 #[cfg(feature = "arbitrary")]
21183 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21184 use arbitrary::{Arbitrary, Unstructured};
21185 let mut buf = [0u8; 1024];
21186 rng.fill_bytes(&mut buf);
21187 let mut unstructured = Unstructured::new(&buf);
21188 Self::arbitrary(&mut unstructured).unwrap_or_default()
21189 }
21190}
21191impl Default for OBSTACLE_DISTANCE_DATA {
21192 fn default() -> Self {
21193 Self::DEFAULT.clone()
21194 }
21195}
21196impl MessageData for OBSTACLE_DISTANCE_DATA {
21197 type Message = MavMessage;
21198 const ID: u32 = 330u32;
21199 const NAME: &'static str = "OBSTACLE_DISTANCE";
21200 const EXTRA_CRC: u8 = 23u8;
21201 const ENCODED_LEN: usize = 167usize;
21202 fn deser(
21203 _version: MavlinkVersion,
21204 __input: &[u8],
21205 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21206 let avail_len = __input.len();
21207 let mut payload_buf = [0; Self::ENCODED_LEN];
21208 let mut buf = if avail_len < Self::ENCODED_LEN {
21209 payload_buf[0..avail_len].copy_from_slice(__input);
21210 Bytes::new(&payload_buf)
21211 } else {
21212 Bytes::new(__input)
21213 };
21214 let mut __struct = Self::default();
21215 __struct.time_usec = buf.get_u64_le();
21216 for v in &mut __struct.distances {
21217 let val = buf.get_u16_le();
21218 *v = val;
21219 }
21220 __struct.min_distance = buf.get_u16_le();
21221 __struct.max_distance = buf.get_u16_le();
21222 let tmp = buf.get_u8();
21223 __struct.sensor_type =
21224 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21225 enum_type: "MavDistanceSensor",
21226 value: tmp as u32,
21227 })?;
21228 __struct.increment = buf.get_u8();
21229 __struct.increment_f = buf.get_f32_le();
21230 __struct.angle_offset = buf.get_f32_le();
21231 let tmp = buf.get_u8();
21232 __struct.frame =
21233 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21234 enum_type: "MavFrame",
21235 value: tmp as u32,
21236 })?;
21237 Ok(__struct)
21238 }
21239 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21240 let mut __tmp = BytesMut::new(bytes);
21241 #[allow(clippy::absurd_extreme_comparisons)]
21242 #[allow(unused_comparisons)]
21243 if __tmp.remaining() < Self::ENCODED_LEN {
21244 panic!(
21245 "buffer is too small (need {} bytes, but got {})",
21246 Self::ENCODED_LEN,
21247 __tmp.remaining(),
21248 )
21249 }
21250 __tmp.put_u64_le(self.time_usec);
21251 for val in &self.distances {
21252 __tmp.put_u16_le(*val);
21253 }
21254 __tmp.put_u16_le(self.min_distance);
21255 __tmp.put_u16_le(self.max_distance);
21256 __tmp.put_u8(self.sensor_type as u8);
21257 __tmp.put_u8(self.increment);
21258 if matches!(version, MavlinkVersion::V2) {
21259 __tmp.put_f32_le(self.increment_f);
21260 __tmp.put_f32_le(self.angle_offset);
21261 __tmp.put_u8(self.frame as u8);
21262 let len = __tmp.len();
21263 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21264 } else {
21265 __tmp.len()
21266 }
21267 }
21268}
21269#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21270#[doc = ""]
21271#[doc = "ID: 331"]
21272#[derive(Debug, Clone, PartialEq)]
21273#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21274#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21275pub struct ODOMETRY_DATA {
21276 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21277 pub time_usec: u64,
21278 #[doc = "X Position"]
21279 pub x: f32,
21280 #[doc = "Y Position"]
21281 pub y: f32,
21282 #[doc = "Z Position"]
21283 pub z: f32,
21284 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21285 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21286 pub q: [f32; 4],
21287 #[doc = "X linear speed"]
21288 pub vx: f32,
21289 #[doc = "Y linear speed"]
21290 pub vy: f32,
21291 #[doc = "Z linear speed"]
21292 pub vz: f32,
21293 #[doc = "Roll angular speed"]
21294 pub rollspeed: f32,
21295 #[doc = "Pitch angular speed"]
21296 pub pitchspeed: f32,
21297 #[doc = "Yaw angular speed"]
21298 pub yawspeed: f32,
21299 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21300 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21301 pub pose_covariance: [f32; 21],
21302 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21303 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21304 pub velocity_covariance: [f32; 21],
21305 #[doc = "Coordinate frame of reference for the pose data."]
21306 pub frame_id: MavFrame,
21307 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21308 pub child_frame_id: MavFrame,
21309 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21310 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21311 pub reset_counter: u8,
21312 #[doc = "Type of estimator that is providing the odometry."]
21313 #[cfg_attr(feature = "serde", serde(default))]
21314 pub estimator_type: MavEstimatorType,
21315 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21316 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21317 pub quality: i8,
21318}
21319impl ODOMETRY_DATA {
21320 pub const ENCODED_LEN: usize = 233usize;
21321 pub const DEFAULT: Self = Self {
21322 time_usec: 0_u64,
21323 x: 0.0_f32,
21324 y: 0.0_f32,
21325 z: 0.0_f32,
21326 q: [0.0_f32; 4usize],
21327 vx: 0.0_f32,
21328 vy: 0.0_f32,
21329 vz: 0.0_f32,
21330 rollspeed: 0.0_f32,
21331 pitchspeed: 0.0_f32,
21332 yawspeed: 0.0_f32,
21333 pose_covariance: [0.0_f32; 21usize],
21334 velocity_covariance: [0.0_f32; 21usize],
21335 frame_id: MavFrame::DEFAULT,
21336 child_frame_id: MavFrame::DEFAULT,
21337 reset_counter: 0_u8,
21338 estimator_type: MavEstimatorType::DEFAULT,
21339 quality: 0_i8,
21340 };
21341 #[cfg(feature = "arbitrary")]
21342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21343 use arbitrary::{Arbitrary, Unstructured};
21344 let mut buf = [0u8; 1024];
21345 rng.fill_bytes(&mut buf);
21346 let mut unstructured = Unstructured::new(&buf);
21347 Self::arbitrary(&mut unstructured).unwrap_or_default()
21348 }
21349}
21350impl Default for ODOMETRY_DATA {
21351 fn default() -> Self {
21352 Self::DEFAULT.clone()
21353 }
21354}
21355impl MessageData for ODOMETRY_DATA {
21356 type Message = MavMessage;
21357 const ID: u32 = 331u32;
21358 const NAME: &'static str = "ODOMETRY";
21359 const EXTRA_CRC: u8 = 91u8;
21360 const ENCODED_LEN: usize = 233usize;
21361 fn deser(
21362 _version: MavlinkVersion,
21363 __input: &[u8],
21364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21365 let avail_len = __input.len();
21366 let mut payload_buf = [0; Self::ENCODED_LEN];
21367 let mut buf = if avail_len < Self::ENCODED_LEN {
21368 payload_buf[0..avail_len].copy_from_slice(__input);
21369 Bytes::new(&payload_buf)
21370 } else {
21371 Bytes::new(__input)
21372 };
21373 let mut __struct = Self::default();
21374 __struct.time_usec = buf.get_u64_le();
21375 __struct.x = buf.get_f32_le();
21376 __struct.y = buf.get_f32_le();
21377 __struct.z = buf.get_f32_le();
21378 for v in &mut __struct.q {
21379 let val = buf.get_f32_le();
21380 *v = val;
21381 }
21382 __struct.vx = buf.get_f32_le();
21383 __struct.vy = buf.get_f32_le();
21384 __struct.vz = buf.get_f32_le();
21385 __struct.rollspeed = buf.get_f32_le();
21386 __struct.pitchspeed = buf.get_f32_le();
21387 __struct.yawspeed = buf.get_f32_le();
21388 for v in &mut __struct.pose_covariance {
21389 let val = buf.get_f32_le();
21390 *v = val;
21391 }
21392 for v in &mut __struct.velocity_covariance {
21393 let val = buf.get_f32_le();
21394 *v = val;
21395 }
21396 let tmp = buf.get_u8();
21397 __struct.frame_id =
21398 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21399 enum_type: "MavFrame",
21400 value: tmp as u32,
21401 })?;
21402 let tmp = buf.get_u8();
21403 __struct.child_frame_id =
21404 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21405 enum_type: "MavFrame",
21406 value: tmp as u32,
21407 })?;
21408 __struct.reset_counter = buf.get_u8();
21409 let tmp = buf.get_u8();
21410 __struct.estimator_type =
21411 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21412 enum_type: "MavEstimatorType",
21413 value: tmp as u32,
21414 })?;
21415 __struct.quality = buf.get_i8();
21416 Ok(__struct)
21417 }
21418 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21419 let mut __tmp = BytesMut::new(bytes);
21420 #[allow(clippy::absurd_extreme_comparisons)]
21421 #[allow(unused_comparisons)]
21422 if __tmp.remaining() < Self::ENCODED_LEN {
21423 panic!(
21424 "buffer is too small (need {} bytes, but got {})",
21425 Self::ENCODED_LEN,
21426 __tmp.remaining(),
21427 )
21428 }
21429 __tmp.put_u64_le(self.time_usec);
21430 __tmp.put_f32_le(self.x);
21431 __tmp.put_f32_le(self.y);
21432 __tmp.put_f32_le(self.z);
21433 for val in &self.q {
21434 __tmp.put_f32_le(*val);
21435 }
21436 __tmp.put_f32_le(self.vx);
21437 __tmp.put_f32_le(self.vy);
21438 __tmp.put_f32_le(self.vz);
21439 __tmp.put_f32_le(self.rollspeed);
21440 __tmp.put_f32_le(self.pitchspeed);
21441 __tmp.put_f32_le(self.yawspeed);
21442 for val in &self.pose_covariance {
21443 __tmp.put_f32_le(*val);
21444 }
21445 for val in &self.velocity_covariance {
21446 __tmp.put_f32_le(*val);
21447 }
21448 __tmp.put_u8(self.frame_id as u8);
21449 __tmp.put_u8(self.child_frame_id as u8);
21450 if matches!(version, MavlinkVersion::V2) {
21451 __tmp.put_u8(self.reset_counter);
21452 __tmp.put_u8(self.estimator_type as u8);
21453 __tmp.put_i8(self.quality);
21454 let len = __tmp.len();
21455 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21456 } else {
21457 __tmp.len()
21458 }
21459 }
21460}
21461#[doc = "Hardware status sent by an onboard computer."]
21462#[doc = ""]
21463#[doc = "ID: 390"]
21464#[derive(Debug, Clone, PartialEq)]
21465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21467pub struct ONBOARD_COMPUTER_STATUS_DATA {
21468 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21469 pub time_usec: u64,
21470 #[doc = "Time since system boot."]
21471 pub uptime: u32,
21472 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21473 pub ram_usage: u32,
21474 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21475 pub ram_total: u32,
21476 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21478 pub storage_type: [u32; 4],
21479 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21480 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21481 pub storage_usage: [u32; 4],
21482 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21483 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21484 pub storage_total: [u32; 4],
21485 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21486 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21487 pub link_type: [u32; 6],
21488 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21489 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21490 pub link_tx_rate: [u32; 6],
21491 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21492 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21493 pub link_rx_rate: [u32; 6],
21494 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21495 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21496 pub link_tx_max: [u32; 6],
21497 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21499 pub link_rx_max: [u32; 6],
21500 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21501 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21502 pub fan_speed: [i16; 4],
21503 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21504 pub mavtype: u8,
21505 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21506 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21507 pub cpu_cores: [u8; 8],
21508 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21509 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21510 pub cpu_combined: [u8; 10],
21511 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21512 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21513 pub gpu_cores: [u8; 4],
21514 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21515 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21516 pub gpu_combined: [u8; 10],
21517 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21518 pub temperature_board: i8,
21519 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21520 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21521 pub temperature_core: [i8; 8],
21522}
21523impl ONBOARD_COMPUTER_STATUS_DATA {
21524 pub const ENCODED_LEN: usize = 238usize;
21525 pub const DEFAULT: Self = Self {
21526 time_usec: 0_u64,
21527 uptime: 0_u32,
21528 ram_usage: 0_u32,
21529 ram_total: 0_u32,
21530 storage_type: [0_u32; 4usize],
21531 storage_usage: [0_u32; 4usize],
21532 storage_total: [0_u32; 4usize],
21533 link_type: [0_u32; 6usize],
21534 link_tx_rate: [0_u32; 6usize],
21535 link_rx_rate: [0_u32; 6usize],
21536 link_tx_max: [0_u32; 6usize],
21537 link_rx_max: [0_u32; 6usize],
21538 fan_speed: [0_i16; 4usize],
21539 mavtype: 0_u8,
21540 cpu_cores: [0_u8; 8usize],
21541 cpu_combined: [0_u8; 10usize],
21542 gpu_cores: [0_u8; 4usize],
21543 gpu_combined: [0_u8; 10usize],
21544 temperature_board: 0_i8,
21545 temperature_core: [0_i8; 8usize],
21546 };
21547 #[cfg(feature = "arbitrary")]
21548 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21549 use arbitrary::{Arbitrary, Unstructured};
21550 let mut buf = [0u8; 1024];
21551 rng.fill_bytes(&mut buf);
21552 let mut unstructured = Unstructured::new(&buf);
21553 Self::arbitrary(&mut unstructured).unwrap_or_default()
21554 }
21555}
21556impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21557 fn default() -> Self {
21558 Self::DEFAULT.clone()
21559 }
21560}
21561impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21562 type Message = MavMessage;
21563 const ID: u32 = 390u32;
21564 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21565 const EXTRA_CRC: u8 = 156u8;
21566 const ENCODED_LEN: usize = 238usize;
21567 fn deser(
21568 _version: MavlinkVersion,
21569 __input: &[u8],
21570 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21571 let avail_len = __input.len();
21572 let mut payload_buf = [0; Self::ENCODED_LEN];
21573 let mut buf = if avail_len < Self::ENCODED_LEN {
21574 payload_buf[0..avail_len].copy_from_slice(__input);
21575 Bytes::new(&payload_buf)
21576 } else {
21577 Bytes::new(__input)
21578 };
21579 let mut __struct = Self::default();
21580 __struct.time_usec = buf.get_u64_le();
21581 __struct.uptime = buf.get_u32_le();
21582 __struct.ram_usage = buf.get_u32_le();
21583 __struct.ram_total = buf.get_u32_le();
21584 for v in &mut __struct.storage_type {
21585 let val = buf.get_u32_le();
21586 *v = val;
21587 }
21588 for v in &mut __struct.storage_usage {
21589 let val = buf.get_u32_le();
21590 *v = val;
21591 }
21592 for v in &mut __struct.storage_total {
21593 let val = buf.get_u32_le();
21594 *v = val;
21595 }
21596 for v in &mut __struct.link_type {
21597 let val = buf.get_u32_le();
21598 *v = val;
21599 }
21600 for v in &mut __struct.link_tx_rate {
21601 let val = buf.get_u32_le();
21602 *v = val;
21603 }
21604 for v in &mut __struct.link_rx_rate {
21605 let val = buf.get_u32_le();
21606 *v = val;
21607 }
21608 for v in &mut __struct.link_tx_max {
21609 let val = buf.get_u32_le();
21610 *v = val;
21611 }
21612 for v in &mut __struct.link_rx_max {
21613 let val = buf.get_u32_le();
21614 *v = val;
21615 }
21616 for v in &mut __struct.fan_speed {
21617 let val = buf.get_i16_le();
21618 *v = val;
21619 }
21620 __struct.mavtype = buf.get_u8();
21621 for v in &mut __struct.cpu_cores {
21622 let val = buf.get_u8();
21623 *v = val;
21624 }
21625 for v in &mut __struct.cpu_combined {
21626 let val = buf.get_u8();
21627 *v = val;
21628 }
21629 for v in &mut __struct.gpu_cores {
21630 let val = buf.get_u8();
21631 *v = val;
21632 }
21633 for v in &mut __struct.gpu_combined {
21634 let val = buf.get_u8();
21635 *v = val;
21636 }
21637 __struct.temperature_board = buf.get_i8();
21638 for v in &mut __struct.temperature_core {
21639 let val = buf.get_i8();
21640 *v = val;
21641 }
21642 Ok(__struct)
21643 }
21644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21645 let mut __tmp = BytesMut::new(bytes);
21646 #[allow(clippy::absurd_extreme_comparisons)]
21647 #[allow(unused_comparisons)]
21648 if __tmp.remaining() < Self::ENCODED_LEN {
21649 panic!(
21650 "buffer is too small (need {} bytes, but got {})",
21651 Self::ENCODED_LEN,
21652 __tmp.remaining(),
21653 )
21654 }
21655 __tmp.put_u64_le(self.time_usec);
21656 __tmp.put_u32_le(self.uptime);
21657 __tmp.put_u32_le(self.ram_usage);
21658 __tmp.put_u32_le(self.ram_total);
21659 for val in &self.storage_type {
21660 __tmp.put_u32_le(*val);
21661 }
21662 for val in &self.storage_usage {
21663 __tmp.put_u32_le(*val);
21664 }
21665 for val in &self.storage_total {
21666 __tmp.put_u32_le(*val);
21667 }
21668 for val in &self.link_type {
21669 __tmp.put_u32_le(*val);
21670 }
21671 for val in &self.link_tx_rate {
21672 __tmp.put_u32_le(*val);
21673 }
21674 for val in &self.link_rx_rate {
21675 __tmp.put_u32_le(*val);
21676 }
21677 for val in &self.link_tx_max {
21678 __tmp.put_u32_le(*val);
21679 }
21680 for val in &self.link_rx_max {
21681 __tmp.put_u32_le(*val);
21682 }
21683 for val in &self.fan_speed {
21684 __tmp.put_i16_le(*val);
21685 }
21686 __tmp.put_u8(self.mavtype);
21687 for val in &self.cpu_cores {
21688 __tmp.put_u8(*val);
21689 }
21690 for val in &self.cpu_combined {
21691 __tmp.put_u8(*val);
21692 }
21693 for val in &self.gpu_cores {
21694 __tmp.put_u8(*val);
21695 }
21696 for val in &self.gpu_combined {
21697 __tmp.put_u8(*val);
21698 }
21699 __tmp.put_i8(self.temperature_board);
21700 for val in &self.temperature_core {
21701 __tmp.put_i8(*val);
21702 }
21703 if matches!(version, MavlinkVersion::V2) {
21704 let len = __tmp.len();
21705 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21706 } else {
21707 __tmp.len()
21708 }
21709 }
21710}
21711#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21712#[doc = ""]
21713#[doc = "ID: 12918"]
21714#[derive(Debug, Clone, PartialEq)]
21715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21717pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21718 #[doc = "Status level indicating if arming is allowed."]
21719 pub status: MavOdidArmStatus,
21720 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21721 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21722 pub error: [u8; 50],
21723}
21724impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21725 pub const ENCODED_LEN: usize = 51usize;
21726 pub const DEFAULT: Self = Self {
21727 status: MavOdidArmStatus::DEFAULT,
21728 error: [0_u8; 50usize],
21729 };
21730 #[cfg(feature = "arbitrary")]
21731 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21732 use arbitrary::{Arbitrary, Unstructured};
21733 let mut buf = [0u8; 1024];
21734 rng.fill_bytes(&mut buf);
21735 let mut unstructured = Unstructured::new(&buf);
21736 Self::arbitrary(&mut unstructured).unwrap_or_default()
21737 }
21738}
21739impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21740 fn default() -> Self {
21741 Self::DEFAULT.clone()
21742 }
21743}
21744impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21745 type Message = MavMessage;
21746 const ID: u32 = 12918u32;
21747 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21748 const EXTRA_CRC: u8 = 139u8;
21749 const ENCODED_LEN: usize = 51usize;
21750 fn deser(
21751 _version: MavlinkVersion,
21752 __input: &[u8],
21753 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21754 let avail_len = __input.len();
21755 let mut payload_buf = [0; Self::ENCODED_LEN];
21756 let mut buf = if avail_len < Self::ENCODED_LEN {
21757 payload_buf[0..avail_len].copy_from_slice(__input);
21758 Bytes::new(&payload_buf)
21759 } else {
21760 Bytes::new(__input)
21761 };
21762 let mut __struct = Self::default();
21763 let tmp = buf.get_u8();
21764 __struct.status =
21765 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21766 enum_type: "MavOdidArmStatus",
21767 value: tmp as u32,
21768 })?;
21769 for v in &mut __struct.error {
21770 let val = buf.get_u8();
21771 *v = val;
21772 }
21773 Ok(__struct)
21774 }
21775 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21776 let mut __tmp = BytesMut::new(bytes);
21777 #[allow(clippy::absurd_extreme_comparisons)]
21778 #[allow(unused_comparisons)]
21779 if __tmp.remaining() < Self::ENCODED_LEN {
21780 panic!(
21781 "buffer is too small (need {} bytes, but got {})",
21782 Self::ENCODED_LEN,
21783 __tmp.remaining(),
21784 )
21785 }
21786 __tmp.put_u8(self.status as u8);
21787 for val in &self.error {
21788 __tmp.put_u8(*val);
21789 }
21790 if matches!(version, MavlinkVersion::V2) {
21791 let len = __tmp.len();
21792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21793 } else {
21794 __tmp.len()
21795 }
21796 }
21797}
21798#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21799#[doc = ""]
21800#[doc = "ID: 12902"]
21801#[derive(Debug, Clone, PartialEq)]
21802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21804pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21805 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21806 pub timestamp: u32,
21807 #[doc = "System ID (0 for broadcast)."]
21808 pub target_system: u8,
21809 #[doc = "Component ID (0 for broadcast)."]
21810 pub target_component: u8,
21811 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21812 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21813 pub id_or_mac: [u8; 20],
21814 #[doc = "Indicates the type of authentication."]
21815 pub authentication_type: MavOdidAuthType,
21816 #[doc = "Allowed range is 0 - 15."]
21817 pub data_page: u8,
21818 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21819 pub last_page_index: u8,
21820 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21821 pub length: u8,
21822 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21823 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21824 pub authentication_data: [u8; 23],
21825}
21826impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21827 pub const ENCODED_LEN: usize = 53usize;
21828 pub const DEFAULT: Self = Self {
21829 timestamp: 0_u32,
21830 target_system: 0_u8,
21831 target_component: 0_u8,
21832 id_or_mac: [0_u8; 20usize],
21833 authentication_type: MavOdidAuthType::DEFAULT,
21834 data_page: 0_u8,
21835 last_page_index: 0_u8,
21836 length: 0_u8,
21837 authentication_data: [0_u8; 23usize],
21838 };
21839 #[cfg(feature = "arbitrary")]
21840 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21841 use arbitrary::{Arbitrary, Unstructured};
21842 let mut buf = [0u8; 1024];
21843 rng.fill_bytes(&mut buf);
21844 let mut unstructured = Unstructured::new(&buf);
21845 Self::arbitrary(&mut unstructured).unwrap_or_default()
21846 }
21847}
21848impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21849 fn default() -> Self {
21850 Self::DEFAULT.clone()
21851 }
21852}
21853impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21854 type Message = MavMessage;
21855 const ID: u32 = 12902u32;
21856 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21857 const EXTRA_CRC: u8 = 140u8;
21858 const ENCODED_LEN: usize = 53usize;
21859 fn deser(
21860 _version: MavlinkVersion,
21861 __input: &[u8],
21862 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21863 let avail_len = __input.len();
21864 let mut payload_buf = [0; Self::ENCODED_LEN];
21865 let mut buf = if avail_len < Self::ENCODED_LEN {
21866 payload_buf[0..avail_len].copy_from_slice(__input);
21867 Bytes::new(&payload_buf)
21868 } else {
21869 Bytes::new(__input)
21870 };
21871 let mut __struct = Self::default();
21872 __struct.timestamp = buf.get_u32_le();
21873 __struct.target_system = buf.get_u8();
21874 __struct.target_component = buf.get_u8();
21875 for v in &mut __struct.id_or_mac {
21876 let val = buf.get_u8();
21877 *v = val;
21878 }
21879 let tmp = buf.get_u8();
21880 __struct.authentication_type =
21881 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21882 enum_type: "MavOdidAuthType",
21883 value: tmp as u32,
21884 })?;
21885 __struct.data_page = buf.get_u8();
21886 __struct.last_page_index = buf.get_u8();
21887 __struct.length = buf.get_u8();
21888 for v in &mut __struct.authentication_data {
21889 let val = buf.get_u8();
21890 *v = val;
21891 }
21892 Ok(__struct)
21893 }
21894 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21895 let mut __tmp = BytesMut::new(bytes);
21896 #[allow(clippy::absurd_extreme_comparisons)]
21897 #[allow(unused_comparisons)]
21898 if __tmp.remaining() < Self::ENCODED_LEN {
21899 panic!(
21900 "buffer is too small (need {} bytes, but got {})",
21901 Self::ENCODED_LEN,
21902 __tmp.remaining(),
21903 )
21904 }
21905 __tmp.put_u32_le(self.timestamp);
21906 __tmp.put_u8(self.target_system);
21907 __tmp.put_u8(self.target_component);
21908 for val in &self.id_or_mac {
21909 __tmp.put_u8(*val);
21910 }
21911 __tmp.put_u8(self.authentication_type as u8);
21912 __tmp.put_u8(self.data_page);
21913 __tmp.put_u8(self.last_page_index);
21914 __tmp.put_u8(self.length);
21915 for val in &self.authentication_data {
21916 __tmp.put_u8(*val);
21917 }
21918 if matches!(version, MavlinkVersion::V2) {
21919 let len = __tmp.len();
21920 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21921 } else {
21922 __tmp.len()
21923 }
21924 }
21925}
21926#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21927#[doc = ""]
21928#[doc = "ID: 12900"]
21929#[derive(Debug, Clone, PartialEq)]
21930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21932pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21933 #[doc = "System ID (0 for broadcast)."]
21934 pub target_system: u8,
21935 #[doc = "Component ID (0 for broadcast)."]
21936 pub target_component: u8,
21937 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21938 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21939 pub id_or_mac: [u8; 20],
21940 #[doc = "Indicates the format for the uas_id field of this message."]
21941 pub id_type: MavOdidIdType,
21942 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21943 pub ua_type: MavOdidUaType,
21944 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21945 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21946 pub uas_id: [u8; 20],
21947}
21948impl OPEN_DRONE_ID_BASIC_ID_DATA {
21949 pub const ENCODED_LEN: usize = 44usize;
21950 pub const DEFAULT: Self = Self {
21951 target_system: 0_u8,
21952 target_component: 0_u8,
21953 id_or_mac: [0_u8; 20usize],
21954 id_type: MavOdidIdType::DEFAULT,
21955 ua_type: MavOdidUaType::DEFAULT,
21956 uas_id: [0_u8; 20usize],
21957 };
21958 #[cfg(feature = "arbitrary")]
21959 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21960 use arbitrary::{Arbitrary, Unstructured};
21961 let mut buf = [0u8; 1024];
21962 rng.fill_bytes(&mut buf);
21963 let mut unstructured = Unstructured::new(&buf);
21964 Self::arbitrary(&mut unstructured).unwrap_or_default()
21965 }
21966}
21967impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21968 fn default() -> Self {
21969 Self::DEFAULT.clone()
21970 }
21971}
21972impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21973 type Message = MavMessage;
21974 const ID: u32 = 12900u32;
21975 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21976 const EXTRA_CRC: u8 = 114u8;
21977 const ENCODED_LEN: usize = 44usize;
21978 fn deser(
21979 _version: MavlinkVersion,
21980 __input: &[u8],
21981 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21982 let avail_len = __input.len();
21983 let mut payload_buf = [0; Self::ENCODED_LEN];
21984 let mut buf = if avail_len < Self::ENCODED_LEN {
21985 payload_buf[0..avail_len].copy_from_slice(__input);
21986 Bytes::new(&payload_buf)
21987 } else {
21988 Bytes::new(__input)
21989 };
21990 let mut __struct = Self::default();
21991 __struct.target_system = buf.get_u8();
21992 __struct.target_component = buf.get_u8();
21993 for v in &mut __struct.id_or_mac {
21994 let val = buf.get_u8();
21995 *v = val;
21996 }
21997 let tmp = buf.get_u8();
21998 __struct.id_type =
21999 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22000 enum_type: "MavOdidIdType",
22001 value: tmp as u32,
22002 })?;
22003 let tmp = buf.get_u8();
22004 __struct.ua_type =
22005 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22006 enum_type: "MavOdidUaType",
22007 value: tmp as u32,
22008 })?;
22009 for v in &mut __struct.uas_id {
22010 let val = buf.get_u8();
22011 *v = val;
22012 }
22013 Ok(__struct)
22014 }
22015 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22016 let mut __tmp = BytesMut::new(bytes);
22017 #[allow(clippy::absurd_extreme_comparisons)]
22018 #[allow(unused_comparisons)]
22019 if __tmp.remaining() < Self::ENCODED_LEN {
22020 panic!(
22021 "buffer is too small (need {} bytes, but got {})",
22022 Self::ENCODED_LEN,
22023 __tmp.remaining(),
22024 )
22025 }
22026 __tmp.put_u8(self.target_system);
22027 __tmp.put_u8(self.target_component);
22028 for val in &self.id_or_mac {
22029 __tmp.put_u8(*val);
22030 }
22031 __tmp.put_u8(self.id_type as u8);
22032 __tmp.put_u8(self.ua_type as u8);
22033 for val in &self.uas_id {
22034 __tmp.put_u8(*val);
22035 }
22036 if matches!(version, MavlinkVersion::V2) {
22037 let len = __tmp.len();
22038 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22039 } else {
22040 __tmp.len()
22041 }
22042 }
22043}
22044#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22045#[doc = ""]
22046#[doc = "ID: 12901"]
22047#[derive(Debug, Clone, PartialEq)]
22048#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22050pub struct OPEN_DRONE_ID_LOCATION_DATA {
22051 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22052 pub latitude: i32,
22053 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22054 pub longitude: i32,
22055 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22056 pub altitude_barometric: f32,
22057 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22058 pub altitude_geodetic: f32,
22059 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22060 pub height: f32,
22061 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22062 pub timestamp: f32,
22063 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22064 pub direction: u16,
22065 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22066 pub speed_horizontal: u16,
22067 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22068 pub speed_vertical: i16,
22069 #[doc = "System ID (0 for broadcast)."]
22070 pub target_system: u8,
22071 #[doc = "Component ID (0 for broadcast)."]
22072 pub target_component: u8,
22073 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22074 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22075 pub id_or_mac: [u8; 20],
22076 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22077 pub status: MavOdidStatus,
22078 #[doc = "Indicates the reference point for the height field."]
22079 pub height_reference: MavOdidHeightRef,
22080 #[doc = "The accuracy of the horizontal position."]
22081 pub horizontal_accuracy: MavOdidHorAcc,
22082 #[doc = "The accuracy of the vertical position."]
22083 pub vertical_accuracy: MavOdidVerAcc,
22084 #[doc = "The accuracy of the barometric altitude."]
22085 pub barometer_accuracy: MavOdidVerAcc,
22086 #[doc = "The accuracy of the horizontal and vertical speed."]
22087 pub speed_accuracy: MavOdidSpeedAcc,
22088 #[doc = "The accuracy of the timestamps."]
22089 pub timestamp_accuracy: MavOdidTimeAcc,
22090}
22091impl OPEN_DRONE_ID_LOCATION_DATA {
22092 pub const ENCODED_LEN: usize = 59usize;
22093 pub const DEFAULT: Self = Self {
22094 latitude: 0_i32,
22095 longitude: 0_i32,
22096 altitude_barometric: 0.0_f32,
22097 altitude_geodetic: 0.0_f32,
22098 height: 0.0_f32,
22099 timestamp: 0.0_f32,
22100 direction: 0_u16,
22101 speed_horizontal: 0_u16,
22102 speed_vertical: 0_i16,
22103 target_system: 0_u8,
22104 target_component: 0_u8,
22105 id_or_mac: [0_u8; 20usize],
22106 status: MavOdidStatus::DEFAULT,
22107 height_reference: MavOdidHeightRef::DEFAULT,
22108 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22109 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22110 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22111 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22112 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22113 };
22114 #[cfg(feature = "arbitrary")]
22115 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22116 use arbitrary::{Arbitrary, Unstructured};
22117 let mut buf = [0u8; 1024];
22118 rng.fill_bytes(&mut buf);
22119 let mut unstructured = Unstructured::new(&buf);
22120 Self::arbitrary(&mut unstructured).unwrap_or_default()
22121 }
22122}
22123impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22124 fn default() -> Self {
22125 Self::DEFAULT.clone()
22126 }
22127}
22128impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22129 type Message = MavMessage;
22130 const ID: u32 = 12901u32;
22131 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22132 const EXTRA_CRC: u8 = 254u8;
22133 const ENCODED_LEN: usize = 59usize;
22134 fn deser(
22135 _version: MavlinkVersion,
22136 __input: &[u8],
22137 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22138 let avail_len = __input.len();
22139 let mut payload_buf = [0; Self::ENCODED_LEN];
22140 let mut buf = if avail_len < Self::ENCODED_LEN {
22141 payload_buf[0..avail_len].copy_from_slice(__input);
22142 Bytes::new(&payload_buf)
22143 } else {
22144 Bytes::new(__input)
22145 };
22146 let mut __struct = Self::default();
22147 __struct.latitude = buf.get_i32_le();
22148 __struct.longitude = buf.get_i32_le();
22149 __struct.altitude_barometric = buf.get_f32_le();
22150 __struct.altitude_geodetic = buf.get_f32_le();
22151 __struct.height = buf.get_f32_le();
22152 __struct.timestamp = buf.get_f32_le();
22153 __struct.direction = buf.get_u16_le();
22154 __struct.speed_horizontal = buf.get_u16_le();
22155 __struct.speed_vertical = buf.get_i16_le();
22156 __struct.target_system = buf.get_u8();
22157 __struct.target_component = buf.get_u8();
22158 for v in &mut __struct.id_or_mac {
22159 let val = buf.get_u8();
22160 *v = val;
22161 }
22162 let tmp = buf.get_u8();
22163 __struct.status =
22164 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22165 enum_type: "MavOdidStatus",
22166 value: tmp as u32,
22167 })?;
22168 let tmp = buf.get_u8();
22169 __struct.height_reference =
22170 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22171 enum_type: "MavOdidHeightRef",
22172 value: tmp as u32,
22173 })?;
22174 let tmp = buf.get_u8();
22175 __struct.horizontal_accuracy =
22176 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22177 enum_type: "MavOdidHorAcc",
22178 value: tmp as u32,
22179 })?;
22180 let tmp = buf.get_u8();
22181 __struct.vertical_accuracy =
22182 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22183 enum_type: "MavOdidVerAcc",
22184 value: tmp as u32,
22185 })?;
22186 let tmp = buf.get_u8();
22187 __struct.barometer_accuracy =
22188 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22189 enum_type: "MavOdidVerAcc",
22190 value: tmp as u32,
22191 })?;
22192 let tmp = buf.get_u8();
22193 __struct.speed_accuracy =
22194 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22195 enum_type: "MavOdidSpeedAcc",
22196 value: tmp as u32,
22197 })?;
22198 let tmp = buf.get_u8();
22199 __struct.timestamp_accuracy =
22200 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22201 enum_type: "MavOdidTimeAcc",
22202 value: tmp as u32,
22203 })?;
22204 Ok(__struct)
22205 }
22206 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22207 let mut __tmp = BytesMut::new(bytes);
22208 #[allow(clippy::absurd_extreme_comparisons)]
22209 #[allow(unused_comparisons)]
22210 if __tmp.remaining() < Self::ENCODED_LEN {
22211 panic!(
22212 "buffer is too small (need {} bytes, but got {})",
22213 Self::ENCODED_LEN,
22214 __tmp.remaining(),
22215 )
22216 }
22217 __tmp.put_i32_le(self.latitude);
22218 __tmp.put_i32_le(self.longitude);
22219 __tmp.put_f32_le(self.altitude_barometric);
22220 __tmp.put_f32_le(self.altitude_geodetic);
22221 __tmp.put_f32_le(self.height);
22222 __tmp.put_f32_le(self.timestamp);
22223 __tmp.put_u16_le(self.direction);
22224 __tmp.put_u16_le(self.speed_horizontal);
22225 __tmp.put_i16_le(self.speed_vertical);
22226 __tmp.put_u8(self.target_system);
22227 __tmp.put_u8(self.target_component);
22228 for val in &self.id_or_mac {
22229 __tmp.put_u8(*val);
22230 }
22231 __tmp.put_u8(self.status as u8);
22232 __tmp.put_u8(self.height_reference as u8);
22233 __tmp.put_u8(self.horizontal_accuracy as u8);
22234 __tmp.put_u8(self.vertical_accuracy as u8);
22235 __tmp.put_u8(self.barometer_accuracy as u8);
22236 __tmp.put_u8(self.speed_accuracy as u8);
22237 __tmp.put_u8(self.timestamp_accuracy as u8);
22238 if matches!(version, MavlinkVersion::V2) {
22239 let len = __tmp.len();
22240 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22241 } else {
22242 __tmp.len()
22243 }
22244 }
22245}
22246#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22247#[doc = ""]
22248#[doc = "ID: 12915"]
22249#[derive(Debug, Clone, PartialEq)]
22250#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22252pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22253 #[doc = "System ID (0 for broadcast)."]
22254 pub target_system: u8,
22255 #[doc = "Component ID (0 for broadcast)."]
22256 pub target_component: u8,
22257 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22258 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22259 pub id_or_mac: [u8; 20],
22260 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22261 pub single_message_size: u8,
22262 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22263 pub msg_pack_size: u8,
22264 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22265 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22266 pub messages: [u8; 225],
22267}
22268impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22269 pub const ENCODED_LEN: usize = 249usize;
22270 pub const DEFAULT: Self = Self {
22271 target_system: 0_u8,
22272 target_component: 0_u8,
22273 id_or_mac: [0_u8; 20usize],
22274 single_message_size: 0_u8,
22275 msg_pack_size: 0_u8,
22276 messages: [0_u8; 225usize],
22277 };
22278 #[cfg(feature = "arbitrary")]
22279 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22280 use arbitrary::{Arbitrary, Unstructured};
22281 let mut buf = [0u8; 1024];
22282 rng.fill_bytes(&mut buf);
22283 let mut unstructured = Unstructured::new(&buf);
22284 Self::arbitrary(&mut unstructured).unwrap_or_default()
22285 }
22286}
22287impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22288 fn default() -> Self {
22289 Self::DEFAULT.clone()
22290 }
22291}
22292impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22293 type Message = MavMessage;
22294 const ID: u32 = 12915u32;
22295 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22296 const EXTRA_CRC: u8 = 94u8;
22297 const ENCODED_LEN: usize = 249usize;
22298 fn deser(
22299 _version: MavlinkVersion,
22300 __input: &[u8],
22301 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22302 let avail_len = __input.len();
22303 let mut payload_buf = [0; Self::ENCODED_LEN];
22304 let mut buf = if avail_len < Self::ENCODED_LEN {
22305 payload_buf[0..avail_len].copy_from_slice(__input);
22306 Bytes::new(&payload_buf)
22307 } else {
22308 Bytes::new(__input)
22309 };
22310 let mut __struct = Self::default();
22311 __struct.target_system = buf.get_u8();
22312 __struct.target_component = buf.get_u8();
22313 for v in &mut __struct.id_or_mac {
22314 let val = buf.get_u8();
22315 *v = val;
22316 }
22317 __struct.single_message_size = buf.get_u8();
22318 __struct.msg_pack_size = buf.get_u8();
22319 for v in &mut __struct.messages {
22320 let val = buf.get_u8();
22321 *v = val;
22322 }
22323 Ok(__struct)
22324 }
22325 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22326 let mut __tmp = BytesMut::new(bytes);
22327 #[allow(clippy::absurd_extreme_comparisons)]
22328 #[allow(unused_comparisons)]
22329 if __tmp.remaining() < Self::ENCODED_LEN {
22330 panic!(
22331 "buffer is too small (need {} bytes, but got {})",
22332 Self::ENCODED_LEN,
22333 __tmp.remaining(),
22334 )
22335 }
22336 __tmp.put_u8(self.target_system);
22337 __tmp.put_u8(self.target_component);
22338 for val in &self.id_or_mac {
22339 __tmp.put_u8(*val);
22340 }
22341 __tmp.put_u8(self.single_message_size);
22342 __tmp.put_u8(self.msg_pack_size);
22343 for val in &self.messages {
22344 __tmp.put_u8(*val);
22345 }
22346 if matches!(version, MavlinkVersion::V2) {
22347 let len = __tmp.len();
22348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22349 } else {
22350 __tmp.len()
22351 }
22352 }
22353}
22354#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22355#[doc = ""]
22356#[doc = "ID: 12905"]
22357#[derive(Debug, Clone, PartialEq)]
22358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22360pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22361 #[doc = "System ID (0 for broadcast)."]
22362 pub target_system: u8,
22363 #[doc = "Component ID (0 for broadcast)."]
22364 pub target_component: u8,
22365 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22366 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22367 pub id_or_mac: [u8; 20],
22368 #[doc = "Indicates the type of the operator_id field."]
22369 pub operator_id_type: MavOdidOperatorIdType,
22370 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22371 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22372 pub operator_id: [u8; 20],
22373}
22374impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22375 pub const ENCODED_LEN: usize = 43usize;
22376 pub const DEFAULT: Self = Self {
22377 target_system: 0_u8,
22378 target_component: 0_u8,
22379 id_or_mac: [0_u8; 20usize],
22380 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22381 operator_id: [0_u8; 20usize],
22382 };
22383 #[cfg(feature = "arbitrary")]
22384 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22385 use arbitrary::{Arbitrary, Unstructured};
22386 let mut buf = [0u8; 1024];
22387 rng.fill_bytes(&mut buf);
22388 let mut unstructured = Unstructured::new(&buf);
22389 Self::arbitrary(&mut unstructured).unwrap_or_default()
22390 }
22391}
22392impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22393 fn default() -> Self {
22394 Self::DEFAULT.clone()
22395 }
22396}
22397impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22398 type Message = MavMessage;
22399 const ID: u32 = 12905u32;
22400 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22401 const EXTRA_CRC: u8 = 49u8;
22402 const ENCODED_LEN: usize = 43usize;
22403 fn deser(
22404 _version: MavlinkVersion,
22405 __input: &[u8],
22406 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22407 let avail_len = __input.len();
22408 let mut payload_buf = [0; Self::ENCODED_LEN];
22409 let mut buf = if avail_len < Self::ENCODED_LEN {
22410 payload_buf[0..avail_len].copy_from_slice(__input);
22411 Bytes::new(&payload_buf)
22412 } else {
22413 Bytes::new(__input)
22414 };
22415 let mut __struct = Self::default();
22416 __struct.target_system = buf.get_u8();
22417 __struct.target_component = buf.get_u8();
22418 for v in &mut __struct.id_or_mac {
22419 let val = buf.get_u8();
22420 *v = val;
22421 }
22422 let tmp = buf.get_u8();
22423 __struct.operator_id_type =
22424 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22425 enum_type: "MavOdidOperatorIdType",
22426 value: tmp as u32,
22427 })?;
22428 for v in &mut __struct.operator_id {
22429 let val = buf.get_u8();
22430 *v = val;
22431 }
22432 Ok(__struct)
22433 }
22434 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22435 let mut __tmp = BytesMut::new(bytes);
22436 #[allow(clippy::absurd_extreme_comparisons)]
22437 #[allow(unused_comparisons)]
22438 if __tmp.remaining() < Self::ENCODED_LEN {
22439 panic!(
22440 "buffer is too small (need {} bytes, but got {})",
22441 Self::ENCODED_LEN,
22442 __tmp.remaining(),
22443 )
22444 }
22445 __tmp.put_u8(self.target_system);
22446 __tmp.put_u8(self.target_component);
22447 for val in &self.id_or_mac {
22448 __tmp.put_u8(*val);
22449 }
22450 __tmp.put_u8(self.operator_id_type as u8);
22451 for val in &self.operator_id {
22452 __tmp.put_u8(*val);
22453 }
22454 if matches!(version, MavlinkVersion::V2) {
22455 let len = __tmp.len();
22456 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22457 } else {
22458 __tmp.len()
22459 }
22460 }
22461}
22462#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22463#[doc = ""]
22464#[doc = "ID: 12903"]
22465#[derive(Debug, Clone, PartialEq)]
22466#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22468pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22469 #[doc = "System ID (0 for broadcast)."]
22470 pub target_system: u8,
22471 #[doc = "Component ID (0 for broadcast)."]
22472 pub target_component: u8,
22473 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22474 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22475 pub id_or_mac: [u8; 20],
22476 #[doc = "Indicates the type of the description field."]
22477 pub description_type: MavOdidDescType,
22478 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22479 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22480 pub description: [u8; 23],
22481}
22482impl OPEN_DRONE_ID_SELF_ID_DATA {
22483 pub const ENCODED_LEN: usize = 46usize;
22484 pub const DEFAULT: Self = Self {
22485 target_system: 0_u8,
22486 target_component: 0_u8,
22487 id_or_mac: [0_u8; 20usize],
22488 description_type: MavOdidDescType::DEFAULT,
22489 description: [0_u8; 23usize],
22490 };
22491 #[cfg(feature = "arbitrary")]
22492 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22493 use arbitrary::{Arbitrary, Unstructured};
22494 let mut buf = [0u8; 1024];
22495 rng.fill_bytes(&mut buf);
22496 let mut unstructured = Unstructured::new(&buf);
22497 Self::arbitrary(&mut unstructured).unwrap_or_default()
22498 }
22499}
22500impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22501 fn default() -> Self {
22502 Self::DEFAULT.clone()
22503 }
22504}
22505impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22506 type Message = MavMessage;
22507 const ID: u32 = 12903u32;
22508 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22509 const EXTRA_CRC: u8 = 249u8;
22510 const ENCODED_LEN: usize = 46usize;
22511 fn deser(
22512 _version: MavlinkVersion,
22513 __input: &[u8],
22514 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22515 let avail_len = __input.len();
22516 let mut payload_buf = [0; Self::ENCODED_LEN];
22517 let mut buf = if avail_len < Self::ENCODED_LEN {
22518 payload_buf[0..avail_len].copy_from_slice(__input);
22519 Bytes::new(&payload_buf)
22520 } else {
22521 Bytes::new(__input)
22522 };
22523 let mut __struct = Self::default();
22524 __struct.target_system = buf.get_u8();
22525 __struct.target_component = buf.get_u8();
22526 for v in &mut __struct.id_or_mac {
22527 let val = buf.get_u8();
22528 *v = val;
22529 }
22530 let tmp = buf.get_u8();
22531 __struct.description_type =
22532 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22533 enum_type: "MavOdidDescType",
22534 value: tmp as u32,
22535 })?;
22536 for v in &mut __struct.description {
22537 let val = buf.get_u8();
22538 *v = val;
22539 }
22540 Ok(__struct)
22541 }
22542 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22543 let mut __tmp = BytesMut::new(bytes);
22544 #[allow(clippy::absurd_extreme_comparisons)]
22545 #[allow(unused_comparisons)]
22546 if __tmp.remaining() < Self::ENCODED_LEN {
22547 panic!(
22548 "buffer is too small (need {} bytes, but got {})",
22549 Self::ENCODED_LEN,
22550 __tmp.remaining(),
22551 )
22552 }
22553 __tmp.put_u8(self.target_system);
22554 __tmp.put_u8(self.target_component);
22555 for val in &self.id_or_mac {
22556 __tmp.put_u8(*val);
22557 }
22558 __tmp.put_u8(self.description_type as u8);
22559 for val in &self.description {
22560 __tmp.put_u8(*val);
22561 }
22562 if matches!(version, MavlinkVersion::V2) {
22563 let len = __tmp.len();
22564 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22565 } else {
22566 __tmp.len()
22567 }
22568 }
22569}
22570#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22571#[doc = ""]
22572#[doc = "ID: 12904"]
22573#[derive(Debug, Clone, PartialEq)]
22574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22576pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22577 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22578 pub operator_latitude: i32,
22579 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22580 pub operator_longitude: i32,
22581 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22582 pub area_ceiling: f32,
22583 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22584 pub area_floor: f32,
22585 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22586 pub operator_altitude_geo: f32,
22587 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22588 pub timestamp: u32,
22589 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22590 pub area_count: u16,
22591 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22592 pub area_radius: u16,
22593 #[doc = "System ID (0 for broadcast)."]
22594 pub target_system: u8,
22595 #[doc = "Component ID (0 for broadcast)."]
22596 pub target_component: u8,
22597 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22598 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22599 pub id_or_mac: [u8; 20],
22600 #[doc = "Specifies the operator location type."]
22601 pub operator_location_type: MavOdidOperatorLocationType,
22602 #[doc = "Specifies the classification type of the UA."]
22603 pub classification_type: MavOdidClassificationType,
22604 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22605 pub category_eu: MavOdidCategoryEu,
22606 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22607 pub class_eu: MavOdidClassEu,
22608}
22609impl OPEN_DRONE_ID_SYSTEM_DATA {
22610 pub const ENCODED_LEN: usize = 54usize;
22611 pub const DEFAULT: Self = Self {
22612 operator_latitude: 0_i32,
22613 operator_longitude: 0_i32,
22614 area_ceiling: 0.0_f32,
22615 area_floor: 0.0_f32,
22616 operator_altitude_geo: 0.0_f32,
22617 timestamp: 0_u32,
22618 area_count: 0_u16,
22619 area_radius: 0_u16,
22620 target_system: 0_u8,
22621 target_component: 0_u8,
22622 id_or_mac: [0_u8; 20usize],
22623 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22624 classification_type: MavOdidClassificationType::DEFAULT,
22625 category_eu: MavOdidCategoryEu::DEFAULT,
22626 class_eu: MavOdidClassEu::DEFAULT,
22627 };
22628 #[cfg(feature = "arbitrary")]
22629 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22630 use arbitrary::{Arbitrary, Unstructured};
22631 let mut buf = [0u8; 1024];
22632 rng.fill_bytes(&mut buf);
22633 let mut unstructured = Unstructured::new(&buf);
22634 Self::arbitrary(&mut unstructured).unwrap_or_default()
22635 }
22636}
22637impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22638 fn default() -> Self {
22639 Self::DEFAULT.clone()
22640 }
22641}
22642impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22643 type Message = MavMessage;
22644 const ID: u32 = 12904u32;
22645 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22646 const EXTRA_CRC: u8 = 77u8;
22647 const ENCODED_LEN: usize = 54usize;
22648 fn deser(
22649 _version: MavlinkVersion,
22650 __input: &[u8],
22651 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22652 let avail_len = __input.len();
22653 let mut payload_buf = [0; Self::ENCODED_LEN];
22654 let mut buf = if avail_len < Self::ENCODED_LEN {
22655 payload_buf[0..avail_len].copy_from_slice(__input);
22656 Bytes::new(&payload_buf)
22657 } else {
22658 Bytes::new(__input)
22659 };
22660 let mut __struct = Self::default();
22661 __struct.operator_latitude = buf.get_i32_le();
22662 __struct.operator_longitude = buf.get_i32_le();
22663 __struct.area_ceiling = buf.get_f32_le();
22664 __struct.area_floor = buf.get_f32_le();
22665 __struct.operator_altitude_geo = buf.get_f32_le();
22666 __struct.timestamp = buf.get_u32_le();
22667 __struct.area_count = buf.get_u16_le();
22668 __struct.area_radius = buf.get_u16_le();
22669 __struct.target_system = buf.get_u8();
22670 __struct.target_component = buf.get_u8();
22671 for v in &mut __struct.id_or_mac {
22672 let val = buf.get_u8();
22673 *v = val;
22674 }
22675 let tmp = buf.get_u8();
22676 __struct.operator_location_type =
22677 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22678 enum_type: "MavOdidOperatorLocationType",
22679 value: tmp as u32,
22680 })?;
22681 let tmp = buf.get_u8();
22682 __struct.classification_type =
22683 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22684 enum_type: "MavOdidClassificationType",
22685 value: tmp as u32,
22686 })?;
22687 let tmp = buf.get_u8();
22688 __struct.category_eu =
22689 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22690 enum_type: "MavOdidCategoryEu",
22691 value: tmp as u32,
22692 })?;
22693 let tmp = buf.get_u8();
22694 __struct.class_eu =
22695 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22696 enum_type: "MavOdidClassEu",
22697 value: tmp as u32,
22698 })?;
22699 Ok(__struct)
22700 }
22701 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22702 let mut __tmp = BytesMut::new(bytes);
22703 #[allow(clippy::absurd_extreme_comparisons)]
22704 #[allow(unused_comparisons)]
22705 if __tmp.remaining() < Self::ENCODED_LEN {
22706 panic!(
22707 "buffer is too small (need {} bytes, but got {})",
22708 Self::ENCODED_LEN,
22709 __tmp.remaining(),
22710 )
22711 }
22712 __tmp.put_i32_le(self.operator_latitude);
22713 __tmp.put_i32_le(self.operator_longitude);
22714 __tmp.put_f32_le(self.area_ceiling);
22715 __tmp.put_f32_le(self.area_floor);
22716 __tmp.put_f32_le(self.operator_altitude_geo);
22717 __tmp.put_u32_le(self.timestamp);
22718 __tmp.put_u16_le(self.area_count);
22719 __tmp.put_u16_le(self.area_radius);
22720 __tmp.put_u8(self.target_system);
22721 __tmp.put_u8(self.target_component);
22722 for val in &self.id_or_mac {
22723 __tmp.put_u8(*val);
22724 }
22725 __tmp.put_u8(self.operator_location_type as u8);
22726 __tmp.put_u8(self.classification_type as u8);
22727 __tmp.put_u8(self.category_eu as u8);
22728 __tmp.put_u8(self.class_eu as u8);
22729 if matches!(version, MavlinkVersion::V2) {
22730 let len = __tmp.len();
22731 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22732 } else {
22733 __tmp.len()
22734 }
22735 }
22736}
22737#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22738#[doc = ""]
22739#[doc = "ID: 12919"]
22740#[derive(Debug, Clone, PartialEq)]
22741#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22742#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22743pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22744 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22745 pub operator_latitude: i32,
22746 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22747 pub operator_longitude: i32,
22748 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22749 pub operator_altitude_geo: f32,
22750 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22751 pub timestamp: u32,
22752 #[doc = "System ID (0 for broadcast)."]
22753 pub target_system: u8,
22754 #[doc = "Component ID (0 for broadcast)."]
22755 pub target_component: u8,
22756}
22757impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22758 pub const ENCODED_LEN: usize = 18usize;
22759 pub const DEFAULT: Self = Self {
22760 operator_latitude: 0_i32,
22761 operator_longitude: 0_i32,
22762 operator_altitude_geo: 0.0_f32,
22763 timestamp: 0_u32,
22764 target_system: 0_u8,
22765 target_component: 0_u8,
22766 };
22767 #[cfg(feature = "arbitrary")]
22768 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22769 use arbitrary::{Arbitrary, Unstructured};
22770 let mut buf = [0u8; 1024];
22771 rng.fill_bytes(&mut buf);
22772 let mut unstructured = Unstructured::new(&buf);
22773 Self::arbitrary(&mut unstructured).unwrap_or_default()
22774 }
22775}
22776impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22777 fn default() -> Self {
22778 Self::DEFAULT.clone()
22779 }
22780}
22781impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22782 type Message = MavMessage;
22783 const ID: u32 = 12919u32;
22784 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22785 const EXTRA_CRC: u8 = 7u8;
22786 const ENCODED_LEN: usize = 18usize;
22787 fn deser(
22788 _version: MavlinkVersion,
22789 __input: &[u8],
22790 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22791 let avail_len = __input.len();
22792 let mut payload_buf = [0; Self::ENCODED_LEN];
22793 let mut buf = if avail_len < Self::ENCODED_LEN {
22794 payload_buf[0..avail_len].copy_from_slice(__input);
22795 Bytes::new(&payload_buf)
22796 } else {
22797 Bytes::new(__input)
22798 };
22799 let mut __struct = Self::default();
22800 __struct.operator_latitude = buf.get_i32_le();
22801 __struct.operator_longitude = buf.get_i32_le();
22802 __struct.operator_altitude_geo = buf.get_f32_le();
22803 __struct.timestamp = buf.get_u32_le();
22804 __struct.target_system = buf.get_u8();
22805 __struct.target_component = buf.get_u8();
22806 Ok(__struct)
22807 }
22808 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22809 let mut __tmp = BytesMut::new(bytes);
22810 #[allow(clippy::absurd_extreme_comparisons)]
22811 #[allow(unused_comparisons)]
22812 if __tmp.remaining() < Self::ENCODED_LEN {
22813 panic!(
22814 "buffer is too small (need {} bytes, but got {})",
22815 Self::ENCODED_LEN,
22816 __tmp.remaining(),
22817 )
22818 }
22819 __tmp.put_i32_le(self.operator_latitude);
22820 __tmp.put_i32_le(self.operator_longitude);
22821 __tmp.put_f32_le(self.operator_altitude_geo);
22822 __tmp.put_u32_le(self.timestamp);
22823 __tmp.put_u8(self.target_system);
22824 __tmp.put_u8(self.target_component);
22825 if matches!(version, MavlinkVersion::V2) {
22826 let len = __tmp.len();
22827 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22828 } else {
22829 __tmp.len()
22830 }
22831 }
22832}
22833#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22834#[doc = ""]
22835#[doc = "ID: 100"]
22836#[derive(Debug, Clone, PartialEq)]
22837#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22839pub struct OPTICAL_FLOW_DATA {
22840 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22841 pub time_usec: u64,
22842 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22843 pub flow_comp_m_x: f32,
22844 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22845 pub flow_comp_m_y: f32,
22846 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22847 pub ground_distance: f32,
22848 #[doc = "Flow in x-sensor direction"]
22849 pub flow_x: i16,
22850 #[doc = "Flow in y-sensor direction"]
22851 pub flow_y: i16,
22852 #[doc = "Sensor ID"]
22853 pub sensor_id: u8,
22854 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22855 pub quality: u8,
22856 #[doc = "Flow rate about X axis"]
22857 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22858 pub flow_rate_x: f32,
22859 #[doc = "Flow rate about Y axis"]
22860 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22861 pub flow_rate_y: f32,
22862}
22863impl OPTICAL_FLOW_DATA {
22864 pub const ENCODED_LEN: usize = 34usize;
22865 pub const DEFAULT: Self = Self {
22866 time_usec: 0_u64,
22867 flow_comp_m_x: 0.0_f32,
22868 flow_comp_m_y: 0.0_f32,
22869 ground_distance: 0.0_f32,
22870 flow_x: 0_i16,
22871 flow_y: 0_i16,
22872 sensor_id: 0_u8,
22873 quality: 0_u8,
22874 flow_rate_x: 0.0_f32,
22875 flow_rate_y: 0.0_f32,
22876 };
22877 #[cfg(feature = "arbitrary")]
22878 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22879 use arbitrary::{Arbitrary, Unstructured};
22880 let mut buf = [0u8; 1024];
22881 rng.fill_bytes(&mut buf);
22882 let mut unstructured = Unstructured::new(&buf);
22883 Self::arbitrary(&mut unstructured).unwrap_or_default()
22884 }
22885}
22886impl Default for OPTICAL_FLOW_DATA {
22887 fn default() -> Self {
22888 Self::DEFAULT.clone()
22889 }
22890}
22891impl MessageData for OPTICAL_FLOW_DATA {
22892 type Message = MavMessage;
22893 const ID: u32 = 100u32;
22894 const NAME: &'static str = "OPTICAL_FLOW";
22895 const EXTRA_CRC: u8 = 175u8;
22896 const ENCODED_LEN: usize = 34usize;
22897 fn deser(
22898 _version: MavlinkVersion,
22899 __input: &[u8],
22900 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22901 let avail_len = __input.len();
22902 let mut payload_buf = [0; Self::ENCODED_LEN];
22903 let mut buf = if avail_len < Self::ENCODED_LEN {
22904 payload_buf[0..avail_len].copy_from_slice(__input);
22905 Bytes::new(&payload_buf)
22906 } else {
22907 Bytes::new(__input)
22908 };
22909 let mut __struct = Self::default();
22910 __struct.time_usec = buf.get_u64_le();
22911 __struct.flow_comp_m_x = buf.get_f32_le();
22912 __struct.flow_comp_m_y = buf.get_f32_le();
22913 __struct.ground_distance = buf.get_f32_le();
22914 __struct.flow_x = buf.get_i16_le();
22915 __struct.flow_y = buf.get_i16_le();
22916 __struct.sensor_id = buf.get_u8();
22917 __struct.quality = buf.get_u8();
22918 __struct.flow_rate_x = buf.get_f32_le();
22919 __struct.flow_rate_y = buf.get_f32_le();
22920 Ok(__struct)
22921 }
22922 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22923 let mut __tmp = BytesMut::new(bytes);
22924 #[allow(clippy::absurd_extreme_comparisons)]
22925 #[allow(unused_comparisons)]
22926 if __tmp.remaining() < Self::ENCODED_LEN {
22927 panic!(
22928 "buffer is too small (need {} bytes, but got {})",
22929 Self::ENCODED_LEN,
22930 __tmp.remaining(),
22931 )
22932 }
22933 __tmp.put_u64_le(self.time_usec);
22934 __tmp.put_f32_le(self.flow_comp_m_x);
22935 __tmp.put_f32_le(self.flow_comp_m_y);
22936 __tmp.put_f32_le(self.ground_distance);
22937 __tmp.put_i16_le(self.flow_x);
22938 __tmp.put_i16_le(self.flow_y);
22939 __tmp.put_u8(self.sensor_id);
22940 __tmp.put_u8(self.quality);
22941 if matches!(version, MavlinkVersion::V2) {
22942 __tmp.put_f32_le(self.flow_rate_x);
22943 __tmp.put_f32_le(self.flow_rate_y);
22944 let len = __tmp.len();
22945 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22946 } else {
22947 __tmp.len()
22948 }
22949 }
22950}
22951#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22952#[doc = ""]
22953#[doc = "ID: 106"]
22954#[derive(Debug, Clone, PartialEq)]
22955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22957pub struct OPTICAL_FLOW_RAD_DATA {
22958 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22959 pub time_usec: u64,
22960 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22961 pub integration_time_us: u32,
22962 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22963 pub integrated_x: f32,
22964 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22965 pub integrated_y: f32,
22966 #[doc = "RH rotation around X axis"]
22967 pub integrated_xgyro: f32,
22968 #[doc = "RH rotation around Y axis"]
22969 pub integrated_ygyro: f32,
22970 #[doc = "RH rotation around Z axis"]
22971 pub integrated_zgyro: f32,
22972 #[doc = "Time since the distance was sampled."]
22973 pub time_delta_distance_us: u32,
22974 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22975 pub distance: f32,
22976 #[doc = "Temperature"]
22977 pub temperature: i16,
22978 #[doc = "Sensor ID"]
22979 pub sensor_id: u8,
22980 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22981 pub quality: u8,
22982}
22983impl OPTICAL_FLOW_RAD_DATA {
22984 pub const ENCODED_LEN: usize = 44usize;
22985 pub const DEFAULT: Self = Self {
22986 time_usec: 0_u64,
22987 integration_time_us: 0_u32,
22988 integrated_x: 0.0_f32,
22989 integrated_y: 0.0_f32,
22990 integrated_xgyro: 0.0_f32,
22991 integrated_ygyro: 0.0_f32,
22992 integrated_zgyro: 0.0_f32,
22993 time_delta_distance_us: 0_u32,
22994 distance: 0.0_f32,
22995 temperature: 0_i16,
22996 sensor_id: 0_u8,
22997 quality: 0_u8,
22998 };
22999 #[cfg(feature = "arbitrary")]
23000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23001 use arbitrary::{Arbitrary, Unstructured};
23002 let mut buf = [0u8; 1024];
23003 rng.fill_bytes(&mut buf);
23004 let mut unstructured = Unstructured::new(&buf);
23005 Self::arbitrary(&mut unstructured).unwrap_or_default()
23006 }
23007}
23008impl Default for OPTICAL_FLOW_RAD_DATA {
23009 fn default() -> Self {
23010 Self::DEFAULT.clone()
23011 }
23012}
23013impl MessageData for OPTICAL_FLOW_RAD_DATA {
23014 type Message = MavMessage;
23015 const ID: u32 = 106u32;
23016 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23017 const EXTRA_CRC: u8 = 138u8;
23018 const ENCODED_LEN: usize = 44usize;
23019 fn deser(
23020 _version: MavlinkVersion,
23021 __input: &[u8],
23022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23023 let avail_len = __input.len();
23024 let mut payload_buf = [0; Self::ENCODED_LEN];
23025 let mut buf = if avail_len < Self::ENCODED_LEN {
23026 payload_buf[0..avail_len].copy_from_slice(__input);
23027 Bytes::new(&payload_buf)
23028 } else {
23029 Bytes::new(__input)
23030 };
23031 let mut __struct = Self::default();
23032 __struct.time_usec = buf.get_u64_le();
23033 __struct.integration_time_us = buf.get_u32_le();
23034 __struct.integrated_x = buf.get_f32_le();
23035 __struct.integrated_y = buf.get_f32_le();
23036 __struct.integrated_xgyro = buf.get_f32_le();
23037 __struct.integrated_ygyro = buf.get_f32_le();
23038 __struct.integrated_zgyro = buf.get_f32_le();
23039 __struct.time_delta_distance_us = buf.get_u32_le();
23040 __struct.distance = buf.get_f32_le();
23041 __struct.temperature = buf.get_i16_le();
23042 __struct.sensor_id = buf.get_u8();
23043 __struct.quality = buf.get_u8();
23044 Ok(__struct)
23045 }
23046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23047 let mut __tmp = BytesMut::new(bytes);
23048 #[allow(clippy::absurd_extreme_comparisons)]
23049 #[allow(unused_comparisons)]
23050 if __tmp.remaining() < Self::ENCODED_LEN {
23051 panic!(
23052 "buffer is too small (need {} bytes, but got {})",
23053 Self::ENCODED_LEN,
23054 __tmp.remaining(),
23055 )
23056 }
23057 __tmp.put_u64_le(self.time_usec);
23058 __tmp.put_u32_le(self.integration_time_us);
23059 __tmp.put_f32_le(self.integrated_x);
23060 __tmp.put_f32_le(self.integrated_y);
23061 __tmp.put_f32_le(self.integrated_xgyro);
23062 __tmp.put_f32_le(self.integrated_ygyro);
23063 __tmp.put_f32_le(self.integrated_zgyro);
23064 __tmp.put_u32_le(self.time_delta_distance_us);
23065 __tmp.put_f32_le(self.distance);
23066 __tmp.put_i16_le(self.temperature);
23067 __tmp.put_u8(self.sensor_id);
23068 __tmp.put_u8(self.quality);
23069 if matches!(version, MavlinkVersion::V2) {
23070 let len = __tmp.len();
23071 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23072 } else {
23073 __tmp.len()
23074 }
23075 }
23076}
23077#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23078#[doc = ""]
23079#[doc = "ID: 360"]
23080#[derive(Debug, Clone, PartialEq)]
23081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23083pub struct ORBIT_EXECUTION_STATUS_DATA {
23084 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23085 pub time_usec: u64,
23086 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23087 pub radius: f32,
23088 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23089 pub x: i32,
23090 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23091 pub y: i32,
23092 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23093 pub z: f32,
23094 #[doc = "The coordinate system of the fields: x, y, z."]
23095 pub frame: MavFrame,
23096}
23097impl ORBIT_EXECUTION_STATUS_DATA {
23098 pub const ENCODED_LEN: usize = 25usize;
23099 pub const DEFAULT: Self = Self {
23100 time_usec: 0_u64,
23101 radius: 0.0_f32,
23102 x: 0_i32,
23103 y: 0_i32,
23104 z: 0.0_f32,
23105 frame: MavFrame::DEFAULT,
23106 };
23107 #[cfg(feature = "arbitrary")]
23108 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23109 use arbitrary::{Arbitrary, Unstructured};
23110 let mut buf = [0u8; 1024];
23111 rng.fill_bytes(&mut buf);
23112 let mut unstructured = Unstructured::new(&buf);
23113 Self::arbitrary(&mut unstructured).unwrap_or_default()
23114 }
23115}
23116impl Default for ORBIT_EXECUTION_STATUS_DATA {
23117 fn default() -> Self {
23118 Self::DEFAULT.clone()
23119 }
23120}
23121impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23122 type Message = MavMessage;
23123 const ID: u32 = 360u32;
23124 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23125 const EXTRA_CRC: u8 = 11u8;
23126 const ENCODED_LEN: usize = 25usize;
23127 fn deser(
23128 _version: MavlinkVersion,
23129 __input: &[u8],
23130 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23131 let avail_len = __input.len();
23132 let mut payload_buf = [0; Self::ENCODED_LEN];
23133 let mut buf = if avail_len < Self::ENCODED_LEN {
23134 payload_buf[0..avail_len].copy_from_slice(__input);
23135 Bytes::new(&payload_buf)
23136 } else {
23137 Bytes::new(__input)
23138 };
23139 let mut __struct = Self::default();
23140 __struct.time_usec = buf.get_u64_le();
23141 __struct.radius = buf.get_f32_le();
23142 __struct.x = buf.get_i32_le();
23143 __struct.y = buf.get_i32_le();
23144 __struct.z = buf.get_f32_le();
23145 let tmp = buf.get_u8();
23146 __struct.frame =
23147 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23148 enum_type: "MavFrame",
23149 value: tmp as u32,
23150 })?;
23151 Ok(__struct)
23152 }
23153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23154 let mut __tmp = BytesMut::new(bytes);
23155 #[allow(clippy::absurd_extreme_comparisons)]
23156 #[allow(unused_comparisons)]
23157 if __tmp.remaining() < Self::ENCODED_LEN {
23158 panic!(
23159 "buffer is too small (need {} bytes, but got {})",
23160 Self::ENCODED_LEN,
23161 __tmp.remaining(),
23162 )
23163 }
23164 __tmp.put_u64_le(self.time_usec);
23165 __tmp.put_f32_le(self.radius);
23166 __tmp.put_i32_le(self.x);
23167 __tmp.put_i32_le(self.y);
23168 __tmp.put_f32_le(self.z);
23169 __tmp.put_u8(self.frame as u8);
23170 if matches!(version, MavlinkVersion::V2) {
23171 let len = __tmp.len();
23172 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23173 } else {
23174 __tmp.len()
23175 }
23176 }
23177}
23178#[doc = "Response from a PARAM_EXT_SET message."]
23179#[doc = ""]
23180#[doc = "ID: 324"]
23181#[derive(Debug, Clone, PartialEq)]
23182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23184pub struct PARAM_EXT_ACK_DATA {
23185 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23186 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23187 pub param_id: [u8; 16],
23188 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23189 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23190 pub param_value: [u8; 128],
23191 #[doc = "Parameter type."]
23192 pub param_type: MavParamExtType,
23193 #[doc = "Result code."]
23194 pub param_result: ParamAck,
23195}
23196impl PARAM_EXT_ACK_DATA {
23197 pub const ENCODED_LEN: usize = 146usize;
23198 pub const DEFAULT: Self = Self {
23199 param_id: [0_u8; 16usize],
23200 param_value: [0_u8; 128usize],
23201 param_type: MavParamExtType::DEFAULT,
23202 param_result: ParamAck::DEFAULT,
23203 };
23204 #[cfg(feature = "arbitrary")]
23205 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23206 use arbitrary::{Arbitrary, Unstructured};
23207 let mut buf = [0u8; 1024];
23208 rng.fill_bytes(&mut buf);
23209 let mut unstructured = Unstructured::new(&buf);
23210 Self::arbitrary(&mut unstructured).unwrap_or_default()
23211 }
23212}
23213impl Default for PARAM_EXT_ACK_DATA {
23214 fn default() -> Self {
23215 Self::DEFAULT.clone()
23216 }
23217}
23218impl MessageData for PARAM_EXT_ACK_DATA {
23219 type Message = MavMessage;
23220 const ID: u32 = 324u32;
23221 const NAME: &'static str = "PARAM_EXT_ACK";
23222 const EXTRA_CRC: u8 = 132u8;
23223 const ENCODED_LEN: usize = 146usize;
23224 fn deser(
23225 _version: MavlinkVersion,
23226 __input: &[u8],
23227 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23228 let avail_len = __input.len();
23229 let mut payload_buf = [0; Self::ENCODED_LEN];
23230 let mut buf = if avail_len < Self::ENCODED_LEN {
23231 payload_buf[0..avail_len].copy_from_slice(__input);
23232 Bytes::new(&payload_buf)
23233 } else {
23234 Bytes::new(__input)
23235 };
23236 let mut __struct = Self::default();
23237 for v in &mut __struct.param_id {
23238 let val = buf.get_u8();
23239 *v = val;
23240 }
23241 for v in &mut __struct.param_value {
23242 let val = buf.get_u8();
23243 *v = val;
23244 }
23245 let tmp = buf.get_u8();
23246 __struct.param_type =
23247 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23248 enum_type: "MavParamExtType",
23249 value: tmp as u32,
23250 })?;
23251 let tmp = buf.get_u8();
23252 __struct.param_result =
23253 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23254 enum_type: "ParamAck",
23255 value: tmp as u32,
23256 })?;
23257 Ok(__struct)
23258 }
23259 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23260 let mut __tmp = BytesMut::new(bytes);
23261 #[allow(clippy::absurd_extreme_comparisons)]
23262 #[allow(unused_comparisons)]
23263 if __tmp.remaining() < Self::ENCODED_LEN {
23264 panic!(
23265 "buffer is too small (need {} bytes, but got {})",
23266 Self::ENCODED_LEN,
23267 __tmp.remaining(),
23268 )
23269 }
23270 for val in &self.param_id {
23271 __tmp.put_u8(*val);
23272 }
23273 for val in &self.param_value {
23274 __tmp.put_u8(*val);
23275 }
23276 __tmp.put_u8(self.param_type as u8);
23277 __tmp.put_u8(self.param_result as u8);
23278 if matches!(version, MavlinkVersion::V2) {
23279 let len = __tmp.len();
23280 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23281 } else {
23282 __tmp.len()
23283 }
23284 }
23285}
23286#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23287#[doc = ""]
23288#[doc = "ID: 321"]
23289#[derive(Debug, Clone, PartialEq)]
23290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23292pub struct PARAM_EXT_REQUEST_LIST_DATA {
23293 #[doc = "System ID"]
23294 pub target_system: u8,
23295 #[doc = "Component ID"]
23296 pub target_component: u8,
23297}
23298impl PARAM_EXT_REQUEST_LIST_DATA {
23299 pub const ENCODED_LEN: usize = 2usize;
23300 pub const DEFAULT: Self = Self {
23301 target_system: 0_u8,
23302 target_component: 0_u8,
23303 };
23304 #[cfg(feature = "arbitrary")]
23305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23306 use arbitrary::{Arbitrary, Unstructured};
23307 let mut buf = [0u8; 1024];
23308 rng.fill_bytes(&mut buf);
23309 let mut unstructured = Unstructured::new(&buf);
23310 Self::arbitrary(&mut unstructured).unwrap_or_default()
23311 }
23312}
23313impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23314 fn default() -> Self {
23315 Self::DEFAULT.clone()
23316 }
23317}
23318impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23319 type Message = MavMessage;
23320 const ID: u32 = 321u32;
23321 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23322 const EXTRA_CRC: u8 = 88u8;
23323 const ENCODED_LEN: usize = 2usize;
23324 fn deser(
23325 _version: MavlinkVersion,
23326 __input: &[u8],
23327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23328 let avail_len = __input.len();
23329 let mut payload_buf = [0; Self::ENCODED_LEN];
23330 let mut buf = if avail_len < Self::ENCODED_LEN {
23331 payload_buf[0..avail_len].copy_from_slice(__input);
23332 Bytes::new(&payload_buf)
23333 } else {
23334 Bytes::new(__input)
23335 };
23336 let mut __struct = Self::default();
23337 __struct.target_system = buf.get_u8();
23338 __struct.target_component = buf.get_u8();
23339 Ok(__struct)
23340 }
23341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23342 let mut __tmp = BytesMut::new(bytes);
23343 #[allow(clippy::absurd_extreme_comparisons)]
23344 #[allow(unused_comparisons)]
23345 if __tmp.remaining() < Self::ENCODED_LEN {
23346 panic!(
23347 "buffer is too small (need {} bytes, but got {})",
23348 Self::ENCODED_LEN,
23349 __tmp.remaining(),
23350 )
23351 }
23352 __tmp.put_u8(self.target_system);
23353 __tmp.put_u8(self.target_component);
23354 if matches!(version, MavlinkVersion::V2) {
23355 let len = __tmp.len();
23356 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23357 } else {
23358 __tmp.len()
23359 }
23360 }
23361}
23362#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23363#[doc = ""]
23364#[doc = "ID: 320"]
23365#[derive(Debug, Clone, PartialEq)]
23366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23368pub struct PARAM_EXT_REQUEST_READ_DATA {
23369 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23370 pub param_index: i16,
23371 #[doc = "System ID"]
23372 pub target_system: u8,
23373 #[doc = "Component ID"]
23374 pub target_component: u8,
23375 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23376 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23377 pub param_id: [u8; 16],
23378}
23379impl PARAM_EXT_REQUEST_READ_DATA {
23380 pub const ENCODED_LEN: usize = 20usize;
23381 pub const DEFAULT: Self = Self {
23382 param_index: 0_i16,
23383 target_system: 0_u8,
23384 target_component: 0_u8,
23385 param_id: [0_u8; 16usize],
23386 };
23387 #[cfg(feature = "arbitrary")]
23388 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23389 use arbitrary::{Arbitrary, Unstructured};
23390 let mut buf = [0u8; 1024];
23391 rng.fill_bytes(&mut buf);
23392 let mut unstructured = Unstructured::new(&buf);
23393 Self::arbitrary(&mut unstructured).unwrap_or_default()
23394 }
23395}
23396impl Default for PARAM_EXT_REQUEST_READ_DATA {
23397 fn default() -> Self {
23398 Self::DEFAULT.clone()
23399 }
23400}
23401impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23402 type Message = MavMessage;
23403 const ID: u32 = 320u32;
23404 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23405 const EXTRA_CRC: u8 = 243u8;
23406 const ENCODED_LEN: usize = 20usize;
23407 fn deser(
23408 _version: MavlinkVersion,
23409 __input: &[u8],
23410 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23411 let avail_len = __input.len();
23412 let mut payload_buf = [0; Self::ENCODED_LEN];
23413 let mut buf = if avail_len < Self::ENCODED_LEN {
23414 payload_buf[0..avail_len].copy_from_slice(__input);
23415 Bytes::new(&payload_buf)
23416 } else {
23417 Bytes::new(__input)
23418 };
23419 let mut __struct = Self::default();
23420 __struct.param_index = buf.get_i16_le();
23421 __struct.target_system = buf.get_u8();
23422 __struct.target_component = buf.get_u8();
23423 for v in &mut __struct.param_id {
23424 let val = buf.get_u8();
23425 *v = val;
23426 }
23427 Ok(__struct)
23428 }
23429 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23430 let mut __tmp = BytesMut::new(bytes);
23431 #[allow(clippy::absurd_extreme_comparisons)]
23432 #[allow(unused_comparisons)]
23433 if __tmp.remaining() < Self::ENCODED_LEN {
23434 panic!(
23435 "buffer is too small (need {} bytes, but got {})",
23436 Self::ENCODED_LEN,
23437 __tmp.remaining(),
23438 )
23439 }
23440 __tmp.put_i16_le(self.param_index);
23441 __tmp.put_u8(self.target_system);
23442 __tmp.put_u8(self.target_component);
23443 for val in &self.param_id {
23444 __tmp.put_u8(*val);
23445 }
23446 if matches!(version, MavlinkVersion::V2) {
23447 let len = __tmp.len();
23448 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23449 } else {
23450 __tmp.len()
23451 }
23452 }
23453}
23454#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23455#[doc = ""]
23456#[doc = "ID: 323"]
23457#[derive(Debug, Clone, PartialEq)]
23458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23460pub struct PARAM_EXT_SET_DATA {
23461 #[doc = "System ID"]
23462 pub target_system: u8,
23463 #[doc = "Component ID"]
23464 pub target_component: u8,
23465 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23466 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23467 pub param_id: [u8; 16],
23468 #[doc = "Parameter value"]
23469 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23470 pub param_value: [u8; 128],
23471 #[doc = "Parameter type."]
23472 pub param_type: MavParamExtType,
23473}
23474impl PARAM_EXT_SET_DATA {
23475 pub const ENCODED_LEN: usize = 147usize;
23476 pub const DEFAULT: Self = Self {
23477 target_system: 0_u8,
23478 target_component: 0_u8,
23479 param_id: [0_u8; 16usize],
23480 param_value: [0_u8; 128usize],
23481 param_type: MavParamExtType::DEFAULT,
23482 };
23483 #[cfg(feature = "arbitrary")]
23484 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23485 use arbitrary::{Arbitrary, Unstructured};
23486 let mut buf = [0u8; 1024];
23487 rng.fill_bytes(&mut buf);
23488 let mut unstructured = Unstructured::new(&buf);
23489 Self::arbitrary(&mut unstructured).unwrap_or_default()
23490 }
23491}
23492impl Default for PARAM_EXT_SET_DATA {
23493 fn default() -> Self {
23494 Self::DEFAULT.clone()
23495 }
23496}
23497impl MessageData for PARAM_EXT_SET_DATA {
23498 type Message = MavMessage;
23499 const ID: u32 = 323u32;
23500 const NAME: &'static str = "PARAM_EXT_SET";
23501 const EXTRA_CRC: u8 = 78u8;
23502 const ENCODED_LEN: usize = 147usize;
23503 fn deser(
23504 _version: MavlinkVersion,
23505 __input: &[u8],
23506 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23507 let avail_len = __input.len();
23508 let mut payload_buf = [0; Self::ENCODED_LEN];
23509 let mut buf = if avail_len < Self::ENCODED_LEN {
23510 payload_buf[0..avail_len].copy_from_slice(__input);
23511 Bytes::new(&payload_buf)
23512 } else {
23513 Bytes::new(__input)
23514 };
23515 let mut __struct = Self::default();
23516 __struct.target_system = buf.get_u8();
23517 __struct.target_component = buf.get_u8();
23518 for v in &mut __struct.param_id {
23519 let val = buf.get_u8();
23520 *v = val;
23521 }
23522 for v in &mut __struct.param_value {
23523 let val = buf.get_u8();
23524 *v = val;
23525 }
23526 let tmp = buf.get_u8();
23527 __struct.param_type =
23528 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23529 enum_type: "MavParamExtType",
23530 value: tmp as u32,
23531 })?;
23532 Ok(__struct)
23533 }
23534 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23535 let mut __tmp = BytesMut::new(bytes);
23536 #[allow(clippy::absurd_extreme_comparisons)]
23537 #[allow(unused_comparisons)]
23538 if __tmp.remaining() < Self::ENCODED_LEN {
23539 panic!(
23540 "buffer is too small (need {} bytes, but got {})",
23541 Self::ENCODED_LEN,
23542 __tmp.remaining(),
23543 )
23544 }
23545 __tmp.put_u8(self.target_system);
23546 __tmp.put_u8(self.target_component);
23547 for val in &self.param_id {
23548 __tmp.put_u8(*val);
23549 }
23550 for val in &self.param_value {
23551 __tmp.put_u8(*val);
23552 }
23553 __tmp.put_u8(self.param_type as u8);
23554 if matches!(version, MavlinkVersion::V2) {
23555 let len = __tmp.len();
23556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23557 } else {
23558 __tmp.len()
23559 }
23560 }
23561}
23562#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23563#[doc = ""]
23564#[doc = "ID: 322"]
23565#[derive(Debug, Clone, PartialEq)]
23566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23568pub struct PARAM_EXT_VALUE_DATA {
23569 #[doc = "Total number of parameters"]
23570 pub param_count: u16,
23571 #[doc = "Index of this parameter"]
23572 pub param_index: u16,
23573 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23574 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23575 pub param_id: [u8; 16],
23576 #[doc = "Parameter value"]
23577 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23578 pub param_value: [u8; 128],
23579 #[doc = "Parameter type."]
23580 pub param_type: MavParamExtType,
23581}
23582impl PARAM_EXT_VALUE_DATA {
23583 pub const ENCODED_LEN: usize = 149usize;
23584 pub const DEFAULT: Self = Self {
23585 param_count: 0_u16,
23586 param_index: 0_u16,
23587 param_id: [0_u8; 16usize],
23588 param_value: [0_u8; 128usize],
23589 param_type: MavParamExtType::DEFAULT,
23590 };
23591 #[cfg(feature = "arbitrary")]
23592 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23593 use arbitrary::{Arbitrary, Unstructured};
23594 let mut buf = [0u8; 1024];
23595 rng.fill_bytes(&mut buf);
23596 let mut unstructured = Unstructured::new(&buf);
23597 Self::arbitrary(&mut unstructured).unwrap_or_default()
23598 }
23599}
23600impl Default for PARAM_EXT_VALUE_DATA {
23601 fn default() -> Self {
23602 Self::DEFAULT.clone()
23603 }
23604}
23605impl MessageData for PARAM_EXT_VALUE_DATA {
23606 type Message = MavMessage;
23607 const ID: u32 = 322u32;
23608 const NAME: &'static str = "PARAM_EXT_VALUE";
23609 const EXTRA_CRC: u8 = 243u8;
23610 const ENCODED_LEN: usize = 149usize;
23611 fn deser(
23612 _version: MavlinkVersion,
23613 __input: &[u8],
23614 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23615 let avail_len = __input.len();
23616 let mut payload_buf = [0; Self::ENCODED_LEN];
23617 let mut buf = if avail_len < Self::ENCODED_LEN {
23618 payload_buf[0..avail_len].copy_from_slice(__input);
23619 Bytes::new(&payload_buf)
23620 } else {
23621 Bytes::new(__input)
23622 };
23623 let mut __struct = Self::default();
23624 __struct.param_count = buf.get_u16_le();
23625 __struct.param_index = buf.get_u16_le();
23626 for v in &mut __struct.param_id {
23627 let val = buf.get_u8();
23628 *v = val;
23629 }
23630 for v in &mut __struct.param_value {
23631 let val = buf.get_u8();
23632 *v = val;
23633 }
23634 let tmp = buf.get_u8();
23635 __struct.param_type =
23636 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23637 enum_type: "MavParamExtType",
23638 value: tmp as u32,
23639 })?;
23640 Ok(__struct)
23641 }
23642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23643 let mut __tmp = BytesMut::new(bytes);
23644 #[allow(clippy::absurd_extreme_comparisons)]
23645 #[allow(unused_comparisons)]
23646 if __tmp.remaining() < Self::ENCODED_LEN {
23647 panic!(
23648 "buffer is too small (need {} bytes, but got {})",
23649 Self::ENCODED_LEN,
23650 __tmp.remaining(),
23651 )
23652 }
23653 __tmp.put_u16_le(self.param_count);
23654 __tmp.put_u16_le(self.param_index);
23655 for val in &self.param_id {
23656 __tmp.put_u8(*val);
23657 }
23658 for val in &self.param_value {
23659 __tmp.put_u8(*val);
23660 }
23661 __tmp.put_u8(self.param_type as u8);
23662 if matches!(version, MavlinkVersion::V2) {
23663 let len = __tmp.len();
23664 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23665 } else {
23666 __tmp.len()
23667 }
23668 }
23669}
23670#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23671#[doc = ""]
23672#[doc = "ID: 50"]
23673#[derive(Debug, Clone, PartialEq)]
23674#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23675#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23676pub struct PARAM_MAP_RC_DATA {
23677 #[doc = "Initial parameter value"]
23678 pub param_value0: f32,
23679 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23680 pub scale: f32,
23681 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23682 pub param_value_min: f32,
23683 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23684 pub param_value_max: f32,
23685 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23686 pub param_index: i16,
23687 #[doc = "System ID"]
23688 pub target_system: u8,
23689 #[doc = "Component ID"]
23690 pub target_component: u8,
23691 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23692 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23693 pub param_id: [u8; 16],
23694 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23695 pub parameter_rc_channel_index: u8,
23696}
23697impl PARAM_MAP_RC_DATA {
23698 pub const ENCODED_LEN: usize = 37usize;
23699 pub const DEFAULT: Self = Self {
23700 param_value0: 0.0_f32,
23701 scale: 0.0_f32,
23702 param_value_min: 0.0_f32,
23703 param_value_max: 0.0_f32,
23704 param_index: 0_i16,
23705 target_system: 0_u8,
23706 target_component: 0_u8,
23707 param_id: [0_u8; 16usize],
23708 parameter_rc_channel_index: 0_u8,
23709 };
23710 #[cfg(feature = "arbitrary")]
23711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23712 use arbitrary::{Arbitrary, Unstructured};
23713 let mut buf = [0u8; 1024];
23714 rng.fill_bytes(&mut buf);
23715 let mut unstructured = Unstructured::new(&buf);
23716 Self::arbitrary(&mut unstructured).unwrap_or_default()
23717 }
23718}
23719impl Default for PARAM_MAP_RC_DATA {
23720 fn default() -> Self {
23721 Self::DEFAULT.clone()
23722 }
23723}
23724impl MessageData for PARAM_MAP_RC_DATA {
23725 type Message = MavMessage;
23726 const ID: u32 = 50u32;
23727 const NAME: &'static str = "PARAM_MAP_RC";
23728 const EXTRA_CRC: u8 = 78u8;
23729 const ENCODED_LEN: usize = 37usize;
23730 fn deser(
23731 _version: MavlinkVersion,
23732 __input: &[u8],
23733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23734 let avail_len = __input.len();
23735 let mut payload_buf = [0; Self::ENCODED_LEN];
23736 let mut buf = if avail_len < Self::ENCODED_LEN {
23737 payload_buf[0..avail_len].copy_from_slice(__input);
23738 Bytes::new(&payload_buf)
23739 } else {
23740 Bytes::new(__input)
23741 };
23742 let mut __struct = Self::default();
23743 __struct.param_value0 = buf.get_f32_le();
23744 __struct.scale = buf.get_f32_le();
23745 __struct.param_value_min = buf.get_f32_le();
23746 __struct.param_value_max = buf.get_f32_le();
23747 __struct.param_index = buf.get_i16_le();
23748 __struct.target_system = buf.get_u8();
23749 __struct.target_component = buf.get_u8();
23750 for v in &mut __struct.param_id {
23751 let val = buf.get_u8();
23752 *v = val;
23753 }
23754 __struct.parameter_rc_channel_index = buf.get_u8();
23755 Ok(__struct)
23756 }
23757 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23758 let mut __tmp = BytesMut::new(bytes);
23759 #[allow(clippy::absurd_extreme_comparisons)]
23760 #[allow(unused_comparisons)]
23761 if __tmp.remaining() < Self::ENCODED_LEN {
23762 panic!(
23763 "buffer is too small (need {} bytes, but got {})",
23764 Self::ENCODED_LEN,
23765 __tmp.remaining(),
23766 )
23767 }
23768 __tmp.put_f32_le(self.param_value0);
23769 __tmp.put_f32_le(self.scale);
23770 __tmp.put_f32_le(self.param_value_min);
23771 __tmp.put_f32_le(self.param_value_max);
23772 __tmp.put_i16_le(self.param_index);
23773 __tmp.put_u8(self.target_system);
23774 __tmp.put_u8(self.target_component);
23775 for val in &self.param_id {
23776 __tmp.put_u8(*val);
23777 }
23778 __tmp.put_u8(self.parameter_rc_channel_index);
23779 if matches!(version, MavlinkVersion::V2) {
23780 let len = __tmp.len();
23781 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23782 } else {
23783 __tmp.len()
23784 }
23785 }
23786}
23787#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23788#[doc = ""]
23789#[doc = "ID: 21"]
23790#[derive(Debug, Clone, PartialEq)]
23791#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23793pub struct PARAM_REQUEST_LIST_DATA {
23794 #[doc = "System ID"]
23795 pub target_system: u8,
23796 #[doc = "Component ID"]
23797 pub target_component: u8,
23798}
23799impl PARAM_REQUEST_LIST_DATA {
23800 pub const ENCODED_LEN: usize = 2usize;
23801 pub const DEFAULT: Self = Self {
23802 target_system: 0_u8,
23803 target_component: 0_u8,
23804 };
23805 #[cfg(feature = "arbitrary")]
23806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23807 use arbitrary::{Arbitrary, Unstructured};
23808 let mut buf = [0u8; 1024];
23809 rng.fill_bytes(&mut buf);
23810 let mut unstructured = Unstructured::new(&buf);
23811 Self::arbitrary(&mut unstructured).unwrap_or_default()
23812 }
23813}
23814impl Default for PARAM_REQUEST_LIST_DATA {
23815 fn default() -> Self {
23816 Self::DEFAULT.clone()
23817 }
23818}
23819impl MessageData for PARAM_REQUEST_LIST_DATA {
23820 type Message = MavMessage;
23821 const ID: u32 = 21u32;
23822 const NAME: &'static str = "PARAM_REQUEST_LIST";
23823 const EXTRA_CRC: u8 = 159u8;
23824 const ENCODED_LEN: usize = 2usize;
23825 fn deser(
23826 _version: MavlinkVersion,
23827 __input: &[u8],
23828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23829 let avail_len = __input.len();
23830 let mut payload_buf = [0; Self::ENCODED_LEN];
23831 let mut buf = if avail_len < Self::ENCODED_LEN {
23832 payload_buf[0..avail_len].copy_from_slice(__input);
23833 Bytes::new(&payload_buf)
23834 } else {
23835 Bytes::new(__input)
23836 };
23837 let mut __struct = Self::default();
23838 __struct.target_system = buf.get_u8();
23839 __struct.target_component = buf.get_u8();
23840 Ok(__struct)
23841 }
23842 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23843 let mut __tmp = BytesMut::new(bytes);
23844 #[allow(clippy::absurd_extreme_comparisons)]
23845 #[allow(unused_comparisons)]
23846 if __tmp.remaining() < Self::ENCODED_LEN {
23847 panic!(
23848 "buffer is too small (need {} bytes, but got {})",
23849 Self::ENCODED_LEN,
23850 __tmp.remaining(),
23851 )
23852 }
23853 __tmp.put_u8(self.target_system);
23854 __tmp.put_u8(self.target_component);
23855 if matches!(version, MavlinkVersion::V2) {
23856 let len = __tmp.len();
23857 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23858 } else {
23859 __tmp.len()
23860 }
23861 }
23862}
23863#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23864#[doc = ""]
23865#[doc = "ID: 20"]
23866#[derive(Debug, Clone, PartialEq)]
23867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23869pub struct PARAM_REQUEST_READ_DATA {
23870 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23871 pub param_index: i16,
23872 #[doc = "System ID"]
23873 pub target_system: u8,
23874 #[doc = "Component ID"]
23875 pub target_component: u8,
23876 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23877 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23878 pub param_id: [u8; 16],
23879}
23880impl PARAM_REQUEST_READ_DATA {
23881 pub const ENCODED_LEN: usize = 20usize;
23882 pub const DEFAULT: Self = Self {
23883 param_index: 0_i16,
23884 target_system: 0_u8,
23885 target_component: 0_u8,
23886 param_id: [0_u8; 16usize],
23887 };
23888 #[cfg(feature = "arbitrary")]
23889 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23890 use arbitrary::{Arbitrary, Unstructured};
23891 let mut buf = [0u8; 1024];
23892 rng.fill_bytes(&mut buf);
23893 let mut unstructured = Unstructured::new(&buf);
23894 Self::arbitrary(&mut unstructured).unwrap_or_default()
23895 }
23896}
23897impl Default for PARAM_REQUEST_READ_DATA {
23898 fn default() -> Self {
23899 Self::DEFAULT.clone()
23900 }
23901}
23902impl MessageData for PARAM_REQUEST_READ_DATA {
23903 type Message = MavMessage;
23904 const ID: u32 = 20u32;
23905 const NAME: &'static str = "PARAM_REQUEST_READ";
23906 const EXTRA_CRC: u8 = 214u8;
23907 const ENCODED_LEN: usize = 20usize;
23908 fn deser(
23909 _version: MavlinkVersion,
23910 __input: &[u8],
23911 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23912 let avail_len = __input.len();
23913 let mut payload_buf = [0; Self::ENCODED_LEN];
23914 let mut buf = if avail_len < Self::ENCODED_LEN {
23915 payload_buf[0..avail_len].copy_from_slice(__input);
23916 Bytes::new(&payload_buf)
23917 } else {
23918 Bytes::new(__input)
23919 };
23920 let mut __struct = Self::default();
23921 __struct.param_index = buf.get_i16_le();
23922 __struct.target_system = buf.get_u8();
23923 __struct.target_component = buf.get_u8();
23924 for v in &mut __struct.param_id {
23925 let val = buf.get_u8();
23926 *v = val;
23927 }
23928 Ok(__struct)
23929 }
23930 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23931 let mut __tmp = BytesMut::new(bytes);
23932 #[allow(clippy::absurd_extreme_comparisons)]
23933 #[allow(unused_comparisons)]
23934 if __tmp.remaining() < Self::ENCODED_LEN {
23935 panic!(
23936 "buffer is too small (need {} bytes, but got {})",
23937 Self::ENCODED_LEN,
23938 __tmp.remaining(),
23939 )
23940 }
23941 __tmp.put_i16_le(self.param_index);
23942 __tmp.put_u8(self.target_system);
23943 __tmp.put_u8(self.target_component);
23944 for val in &self.param_id {
23945 __tmp.put_u8(*val);
23946 }
23947 if matches!(version, MavlinkVersion::V2) {
23948 let len = __tmp.len();
23949 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23950 } else {
23951 __tmp.len()
23952 }
23953 }
23954}
23955#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23956#[doc = ""]
23957#[doc = "ID: 23"]
23958#[derive(Debug, Clone, PartialEq)]
23959#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23960#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23961pub struct PARAM_SET_DATA {
23962 #[doc = "Onboard parameter value"]
23963 pub param_value: f32,
23964 #[doc = "System ID"]
23965 pub target_system: u8,
23966 #[doc = "Component ID"]
23967 pub target_component: u8,
23968 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23969 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23970 pub param_id: [u8; 16],
23971 #[doc = "Onboard parameter type."]
23972 pub param_type: MavParamType,
23973}
23974impl PARAM_SET_DATA {
23975 pub const ENCODED_LEN: usize = 23usize;
23976 pub const DEFAULT: Self = Self {
23977 param_value: 0.0_f32,
23978 target_system: 0_u8,
23979 target_component: 0_u8,
23980 param_id: [0_u8; 16usize],
23981 param_type: MavParamType::DEFAULT,
23982 };
23983 #[cfg(feature = "arbitrary")]
23984 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23985 use arbitrary::{Arbitrary, Unstructured};
23986 let mut buf = [0u8; 1024];
23987 rng.fill_bytes(&mut buf);
23988 let mut unstructured = Unstructured::new(&buf);
23989 Self::arbitrary(&mut unstructured).unwrap_or_default()
23990 }
23991}
23992impl Default for PARAM_SET_DATA {
23993 fn default() -> Self {
23994 Self::DEFAULT.clone()
23995 }
23996}
23997impl MessageData for PARAM_SET_DATA {
23998 type Message = MavMessage;
23999 const ID: u32 = 23u32;
24000 const NAME: &'static str = "PARAM_SET";
24001 const EXTRA_CRC: u8 = 168u8;
24002 const ENCODED_LEN: usize = 23usize;
24003 fn deser(
24004 _version: MavlinkVersion,
24005 __input: &[u8],
24006 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24007 let avail_len = __input.len();
24008 let mut payload_buf = [0; Self::ENCODED_LEN];
24009 let mut buf = if avail_len < Self::ENCODED_LEN {
24010 payload_buf[0..avail_len].copy_from_slice(__input);
24011 Bytes::new(&payload_buf)
24012 } else {
24013 Bytes::new(__input)
24014 };
24015 let mut __struct = Self::default();
24016 __struct.param_value = buf.get_f32_le();
24017 __struct.target_system = buf.get_u8();
24018 __struct.target_component = buf.get_u8();
24019 for v in &mut __struct.param_id {
24020 let val = buf.get_u8();
24021 *v = val;
24022 }
24023 let tmp = buf.get_u8();
24024 __struct.param_type =
24025 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24026 enum_type: "MavParamType",
24027 value: tmp as u32,
24028 })?;
24029 Ok(__struct)
24030 }
24031 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24032 let mut __tmp = BytesMut::new(bytes);
24033 #[allow(clippy::absurd_extreme_comparisons)]
24034 #[allow(unused_comparisons)]
24035 if __tmp.remaining() < Self::ENCODED_LEN {
24036 panic!(
24037 "buffer is too small (need {} bytes, but got {})",
24038 Self::ENCODED_LEN,
24039 __tmp.remaining(),
24040 )
24041 }
24042 __tmp.put_f32_le(self.param_value);
24043 __tmp.put_u8(self.target_system);
24044 __tmp.put_u8(self.target_component);
24045 for val in &self.param_id {
24046 __tmp.put_u8(*val);
24047 }
24048 __tmp.put_u8(self.param_type as u8);
24049 if matches!(version, MavlinkVersion::V2) {
24050 let len = __tmp.len();
24051 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24052 } else {
24053 __tmp.len()
24054 }
24055 }
24056}
24057#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24058#[doc = ""]
24059#[doc = "ID: 22"]
24060#[derive(Debug, Clone, PartialEq)]
24061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24063pub struct PARAM_VALUE_DATA {
24064 #[doc = "Onboard parameter value"]
24065 pub param_value: f32,
24066 #[doc = "Total number of onboard parameters"]
24067 pub param_count: u16,
24068 #[doc = "Index of this onboard parameter"]
24069 pub param_index: u16,
24070 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24071 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24072 pub param_id: [u8; 16],
24073 #[doc = "Onboard parameter type."]
24074 pub param_type: MavParamType,
24075}
24076impl PARAM_VALUE_DATA {
24077 pub const ENCODED_LEN: usize = 25usize;
24078 pub const DEFAULT: Self = Self {
24079 param_value: 0.0_f32,
24080 param_count: 0_u16,
24081 param_index: 0_u16,
24082 param_id: [0_u8; 16usize],
24083 param_type: MavParamType::DEFAULT,
24084 };
24085 #[cfg(feature = "arbitrary")]
24086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24087 use arbitrary::{Arbitrary, Unstructured};
24088 let mut buf = [0u8; 1024];
24089 rng.fill_bytes(&mut buf);
24090 let mut unstructured = Unstructured::new(&buf);
24091 Self::arbitrary(&mut unstructured).unwrap_or_default()
24092 }
24093}
24094impl Default for PARAM_VALUE_DATA {
24095 fn default() -> Self {
24096 Self::DEFAULT.clone()
24097 }
24098}
24099impl MessageData for PARAM_VALUE_DATA {
24100 type Message = MavMessage;
24101 const ID: u32 = 22u32;
24102 const NAME: &'static str = "PARAM_VALUE";
24103 const EXTRA_CRC: u8 = 220u8;
24104 const ENCODED_LEN: usize = 25usize;
24105 fn deser(
24106 _version: MavlinkVersion,
24107 __input: &[u8],
24108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24109 let avail_len = __input.len();
24110 let mut payload_buf = [0; Self::ENCODED_LEN];
24111 let mut buf = if avail_len < Self::ENCODED_LEN {
24112 payload_buf[0..avail_len].copy_from_slice(__input);
24113 Bytes::new(&payload_buf)
24114 } else {
24115 Bytes::new(__input)
24116 };
24117 let mut __struct = Self::default();
24118 __struct.param_value = buf.get_f32_le();
24119 __struct.param_count = buf.get_u16_le();
24120 __struct.param_index = buf.get_u16_le();
24121 for v in &mut __struct.param_id {
24122 let val = buf.get_u8();
24123 *v = val;
24124 }
24125 let tmp = buf.get_u8();
24126 __struct.param_type =
24127 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24128 enum_type: "MavParamType",
24129 value: tmp as u32,
24130 })?;
24131 Ok(__struct)
24132 }
24133 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24134 let mut __tmp = BytesMut::new(bytes);
24135 #[allow(clippy::absurd_extreme_comparisons)]
24136 #[allow(unused_comparisons)]
24137 if __tmp.remaining() < Self::ENCODED_LEN {
24138 panic!(
24139 "buffer is too small (need {} bytes, but got {})",
24140 Self::ENCODED_LEN,
24141 __tmp.remaining(),
24142 )
24143 }
24144 __tmp.put_f32_le(self.param_value);
24145 __tmp.put_u16_le(self.param_count);
24146 __tmp.put_u16_le(self.param_index);
24147 for val in &self.param_id {
24148 __tmp.put_u8(*val);
24149 }
24150 __tmp.put_u8(self.param_type as u8);
24151 if matches!(version, MavlinkVersion::V2) {
24152 let len = __tmp.len();
24153 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24154 } else {
24155 __tmp.len()
24156 }
24157 }
24158}
24159#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24160#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24161#[doc = ""]
24162#[doc = "ID: 4"]
24163#[derive(Debug, Clone, PartialEq)]
24164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24165#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24166pub struct PING_DATA {
24167 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24168 pub time_usec: u64,
24169 #[doc = "PING sequence"]
24170 pub seq: u32,
24171 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24172 pub target_system: u8,
24173 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24174 pub target_component: u8,
24175}
24176impl PING_DATA {
24177 pub const ENCODED_LEN: usize = 14usize;
24178 pub const DEFAULT: Self = Self {
24179 time_usec: 0_u64,
24180 seq: 0_u32,
24181 target_system: 0_u8,
24182 target_component: 0_u8,
24183 };
24184 #[cfg(feature = "arbitrary")]
24185 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24186 use arbitrary::{Arbitrary, Unstructured};
24187 let mut buf = [0u8; 1024];
24188 rng.fill_bytes(&mut buf);
24189 let mut unstructured = Unstructured::new(&buf);
24190 Self::arbitrary(&mut unstructured).unwrap_or_default()
24191 }
24192}
24193impl Default for PING_DATA {
24194 fn default() -> Self {
24195 Self::DEFAULT.clone()
24196 }
24197}
24198impl MessageData for PING_DATA {
24199 type Message = MavMessage;
24200 const ID: u32 = 4u32;
24201 const NAME: &'static str = "PING";
24202 const EXTRA_CRC: u8 = 237u8;
24203 const ENCODED_LEN: usize = 14usize;
24204 fn deser(
24205 _version: MavlinkVersion,
24206 __input: &[u8],
24207 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24208 let avail_len = __input.len();
24209 let mut payload_buf = [0; Self::ENCODED_LEN];
24210 let mut buf = if avail_len < Self::ENCODED_LEN {
24211 payload_buf[0..avail_len].copy_from_slice(__input);
24212 Bytes::new(&payload_buf)
24213 } else {
24214 Bytes::new(__input)
24215 };
24216 let mut __struct = Self::default();
24217 __struct.time_usec = buf.get_u64_le();
24218 __struct.seq = buf.get_u32_le();
24219 __struct.target_system = buf.get_u8();
24220 __struct.target_component = buf.get_u8();
24221 Ok(__struct)
24222 }
24223 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24224 let mut __tmp = BytesMut::new(bytes);
24225 #[allow(clippy::absurd_extreme_comparisons)]
24226 #[allow(unused_comparisons)]
24227 if __tmp.remaining() < Self::ENCODED_LEN {
24228 panic!(
24229 "buffer is too small (need {} bytes, but got {})",
24230 Self::ENCODED_LEN,
24231 __tmp.remaining(),
24232 )
24233 }
24234 __tmp.put_u64_le(self.time_usec);
24235 __tmp.put_u32_le(self.seq);
24236 __tmp.put_u8(self.target_system);
24237 __tmp.put_u8(self.target_component);
24238 if matches!(version, MavlinkVersion::V2) {
24239 let len = __tmp.len();
24240 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24241 } else {
24242 __tmp.len()
24243 }
24244 }
24245}
24246#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24247#[doc = "Control vehicle tone generation (buzzer)."]
24248#[doc = ""]
24249#[doc = "ID: 258"]
24250#[derive(Debug, Clone, PartialEq)]
24251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24252#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24253pub struct PLAY_TUNE_DATA {
24254 #[doc = "System ID"]
24255 pub target_system: u8,
24256 #[doc = "Component ID"]
24257 pub target_component: u8,
24258 #[doc = "tune in board specific format"]
24259 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24260 pub tune: [u8; 30],
24261 #[doc = "tune extension (appended to tune)"]
24262 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24263 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24264 pub tune2: [u8; 200],
24265}
24266impl PLAY_TUNE_DATA {
24267 pub const ENCODED_LEN: usize = 232usize;
24268 pub const DEFAULT: Self = Self {
24269 target_system: 0_u8,
24270 target_component: 0_u8,
24271 tune: [0_u8; 30usize],
24272 tune2: [0_u8; 200usize],
24273 };
24274 #[cfg(feature = "arbitrary")]
24275 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24276 use arbitrary::{Arbitrary, Unstructured};
24277 let mut buf = [0u8; 1024];
24278 rng.fill_bytes(&mut buf);
24279 let mut unstructured = Unstructured::new(&buf);
24280 Self::arbitrary(&mut unstructured).unwrap_or_default()
24281 }
24282}
24283impl Default for PLAY_TUNE_DATA {
24284 fn default() -> Self {
24285 Self::DEFAULT.clone()
24286 }
24287}
24288impl MessageData for PLAY_TUNE_DATA {
24289 type Message = MavMessage;
24290 const ID: u32 = 258u32;
24291 const NAME: &'static str = "PLAY_TUNE";
24292 const EXTRA_CRC: u8 = 187u8;
24293 const ENCODED_LEN: usize = 232usize;
24294 fn deser(
24295 _version: MavlinkVersion,
24296 __input: &[u8],
24297 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24298 let avail_len = __input.len();
24299 let mut payload_buf = [0; Self::ENCODED_LEN];
24300 let mut buf = if avail_len < Self::ENCODED_LEN {
24301 payload_buf[0..avail_len].copy_from_slice(__input);
24302 Bytes::new(&payload_buf)
24303 } else {
24304 Bytes::new(__input)
24305 };
24306 let mut __struct = Self::default();
24307 __struct.target_system = buf.get_u8();
24308 __struct.target_component = buf.get_u8();
24309 for v in &mut __struct.tune {
24310 let val = buf.get_u8();
24311 *v = val;
24312 }
24313 for v in &mut __struct.tune2 {
24314 let val = buf.get_u8();
24315 *v = val;
24316 }
24317 Ok(__struct)
24318 }
24319 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24320 let mut __tmp = BytesMut::new(bytes);
24321 #[allow(clippy::absurd_extreme_comparisons)]
24322 #[allow(unused_comparisons)]
24323 if __tmp.remaining() < Self::ENCODED_LEN {
24324 panic!(
24325 "buffer is too small (need {} bytes, but got {})",
24326 Self::ENCODED_LEN,
24327 __tmp.remaining(),
24328 )
24329 }
24330 __tmp.put_u8(self.target_system);
24331 __tmp.put_u8(self.target_component);
24332 for val in &self.tune {
24333 __tmp.put_u8(*val);
24334 }
24335 if matches!(version, MavlinkVersion::V2) {
24336 for val in &self.tune2 {
24337 __tmp.put_u8(*val);
24338 }
24339 let len = __tmp.len();
24340 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24341 } else {
24342 __tmp.len()
24343 }
24344 }
24345}
24346#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24347#[doc = ""]
24348#[doc = "ID: 400"]
24349#[derive(Debug, Clone, PartialEq)]
24350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24352pub struct PLAY_TUNE_V2_DATA {
24353 #[doc = "Tune format"]
24354 pub format: TuneFormat,
24355 #[doc = "System ID"]
24356 pub target_system: u8,
24357 #[doc = "Component ID"]
24358 pub target_component: u8,
24359 #[doc = "Tune definition as a NULL-terminated string."]
24360 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24361 pub tune: [u8; 248],
24362}
24363impl PLAY_TUNE_V2_DATA {
24364 pub const ENCODED_LEN: usize = 254usize;
24365 pub const DEFAULT: Self = Self {
24366 format: TuneFormat::DEFAULT,
24367 target_system: 0_u8,
24368 target_component: 0_u8,
24369 tune: [0_u8; 248usize],
24370 };
24371 #[cfg(feature = "arbitrary")]
24372 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24373 use arbitrary::{Arbitrary, Unstructured};
24374 let mut buf = [0u8; 1024];
24375 rng.fill_bytes(&mut buf);
24376 let mut unstructured = Unstructured::new(&buf);
24377 Self::arbitrary(&mut unstructured).unwrap_or_default()
24378 }
24379}
24380impl Default for PLAY_TUNE_V2_DATA {
24381 fn default() -> Self {
24382 Self::DEFAULT.clone()
24383 }
24384}
24385impl MessageData for PLAY_TUNE_V2_DATA {
24386 type Message = MavMessage;
24387 const ID: u32 = 400u32;
24388 const NAME: &'static str = "PLAY_TUNE_V2";
24389 const EXTRA_CRC: u8 = 110u8;
24390 const ENCODED_LEN: usize = 254usize;
24391 fn deser(
24392 _version: MavlinkVersion,
24393 __input: &[u8],
24394 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24395 let avail_len = __input.len();
24396 let mut payload_buf = [0; Self::ENCODED_LEN];
24397 let mut buf = if avail_len < Self::ENCODED_LEN {
24398 payload_buf[0..avail_len].copy_from_slice(__input);
24399 Bytes::new(&payload_buf)
24400 } else {
24401 Bytes::new(__input)
24402 };
24403 let mut __struct = Self::default();
24404 let tmp = buf.get_u32_le();
24405 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24406 ::mavlink_core::error::ParserError::InvalidEnum {
24407 enum_type: "TuneFormat",
24408 value: tmp as u32,
24409 },
24410 )?;
24411 __struct.target_system = buf.get_u8();
24412 __struct.target_component = buf.get_u8();
24413 for v in &mut __struct.tune {
24414 let val = buf.get_u8();
24415 *v = val;
24416 }
24417 Ok(__struct)
24418 }
24419 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24420 let mut __tmp = BytesMut::new(bytes);
24421 #[allow(clippy::absurd_extreme_comparisons)]
24422 #[allow(unused_comparisons)]
24423 if __tmp.remaining() < Self::ENCODED_LEN {
24424 panic!(
24425 "buffer is too small (need {} bytes, but got {})",
24426 Self::ENCODED_LEN,
24427 __tmp.remaining(),
24428 )
24429 }
24430 __tmp.put_u32_le(self.format as u32);
24431 __tmp.put_u8(self.target_system);
24432 __tmp.put_u8(self.target_component);
24433 for val in &self.tune {
24434 __tmp.put_u8(*val);
24435 }
24436 if matches!(version, MavlinkVersion::V2) {
24437 let len = __tmp.len();
24438 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24439 } else {
24440 __tmp.len()
24441 }
24442 }
24443}
24444#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24445#[doc = ""]
24446#[doc = "ID: 87"]
24447#[derive(Debug, Clone, PartialEq)]
24448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24450pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24451 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24452 pub time_boot_ms: u32,
24453 #[doc = "Latitude in WGS84 frame"]
24454 pub lat_int: i32,
24455 #[doc = "Longitude in WGS84 frame"]
24456 pub lon_int: i32,
24457 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24458 pub alt: f32,
24459 #[doc = "X velocity in NED frame"]
24460 pub vx: f32,
24461 #[doc = "Y velocity in NED frame"]
24462 pub vy: f32,
24463 #[doc = "Z velocity in NED frame"]
24464 pub vz: f32,
24465 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24466 pub afx: f32,
24467 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24468 pub afy: f32,
24469 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24470 pub afz: f32,
24471 #[doc = "yaw setpoint"]
24472 pub yaw: f32,
24473 #[doc = "yaw rate setpoint"]
24474 pub yaw_rate: f32,
24475 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24476 pub type_mask: PositionTargetTypemask,
24477 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24478 pub coordinate_frame: MavFrame,
24479}
24480impl POSITION_TARGET_GLOBAL_INT_DATA {
24481 pub const ENCODED_LEN: usize = 51usize;
24482 pub const DEFAULT: Self = Self {
24483 time_boot_ms: 0_u32,
24484 lat_int: 0_i32,
24485 lon_int: 0_i32,
24486 alt: 0.0_f32,
24487 vx: 0.0_f32,
24488 vy: 0.0_f32,
24489 vz: 0.0_f32,
24490 afx: 0.0_f32,
24491 afy: 0.0_f32,
24492 afz: 0.0_f32,
24493 yaw: 0.0_f32,
24494 yaw_rate: 0.0_f32,
24495 type_mask: PositionTargetTypemask::DEFAULT,
24496 coordinate_frame: MavFrame::DEFAULT,
24497 };
24498 #[cfg(feature = "arbitrary")]
24499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24500 use arbitrary::{Arbitrary, Unstructured};
24501 let mut buf = [0u8; 1024];
24502 rng.fill_bytes(&mut buf);
24503 let mut unstructured = Unstructured::new(&buf);
24504 Self::arbitrary(&mut unstructured).unwrap_or_default()
24505 }
24506}
24507impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24508 fn default() -> Self {
24509 Self::DEFAULT.clone()
24510 }
24511}
24512impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24513 type Message = MavMessage;
24514 const ID: u32 = 87u32;
24515 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24516 const EXTRA_CRC: u8 = 150u8;
24517 const ENCODED_LEN: usize = 51usize;
24518 fn deser(
24519 _version: MavlinkVersion,
24520 __input: &[u8],
24521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24522 let avail_len = __input.len();
24523 let mut payload_buf = [0; Self::ENCODED_LEN];
24524 let mut buf = if avail_len < Self::ENCODED_LEN {
24525 payload_buf[0..avail_len].copy_from_slice(__input);
24526 Bytes::new(&payload_buf)
24527 } else {
24528 Bytes::new(__input)
24529 };
24530 let mut __struct = Self::default();
24531 __struct.time_boot_ms = buf.get_u32_le();
24532 __struct.lat_int = buf.get_i32_le();
24533 __struct.lon_int = buf.get_i32_le();
24534 __struct.alt = buf.get_f32_le();
24535 __struct.vx = buf.get_f32_le();
24536 __struct.vy = buf.get_f32_le();
24537 __struct.vz = buf.get_f32_le();
24538 __struct.afx = buf.get_f32_le();
24539 __struct.afy = buf.get_f32_le();
24540 __struct.afz = buf.get_f32_le();
24541 __struct.yaw = buf.get_f32_le();
24542 __struct.yaw_rate = buf.get_f32_le();
24543 let tmp = buf.get_u16_le();
24544 __struct.type_mask = PositionTargetTypemask::from_bits(
24545 tmp & PositionTargetTypemask::all().bits(),
24546 )
24547 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24548 flag_type: "PositionTargetTypemask",
24549 value: tmp as u32,
24550 })?;
24551 let tmp = buf.get_u8();
24552 __struct.coordinate_frame =
24553 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24554 enum_type: "MavFrame",
24555 value: tmp as u32,
24556 })?;
24557 Ok(__struct)
24558 }
24559 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24560 let mut __tmp = BytesMut::new(bytes);
24561 #[allow(clippy::absurd_extreme_comparisons)]
24562 #[allow(unused_comparisons)]
24563 if __tmp.remaining() < Self::ENCODED_LEN {
24564 panic!(
24565 "buffer is too small (need {} bytes, but got {})",
24566 Self::ENCODED_LEN,
24567 __tmp.remaining(),
24568 )
24569 }
24570 __tmp.put_u32_le(self.time_boot_ms);
24571 __tmp.put_i32_le(self.lat_int);
24572 __tmp.put_i32_le(self.lon_int);
24573 __tmp.put_f32_le(self.alt);
24574 __tmp.put_f32_le(self.vx);
24575 __tmp.put_f32_le(self.vy);
24576 __tmp.put_f32_le(self.vz);
24577 __tmp.put_f32_le(self.afx);
24578 __tmp.put_f32_le(self.afy);
24579 __tmp.put_f32_le(self.afz);
24580 __tmp.put_f32_le(self.yaw);
24581 __tmp.put_f32_le(self.yaw_rate);
24582 __tmp.put_u16_le(self.type_mask.bits());
24583 __tmp.put_u8(self.coordinate_frame as u8);
24584 if matches!(version, MavlinkVersion::V2) {
24585 let len = __tmp.len();
24586 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24587 } else {
24588 __tmp.len()
24589 }
24590 }
24591}
24592#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24593#[doc = ""]
24594#[doc = "ID: 85"]
24595#[derive(Debug, Clone, PartialEq)]
24596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24598pub struct POSITION_TARGET_LOCAL_NED_DATA {
24599 #[doc = "Timestamp (time since system boot)."]
24600 pub time_boot_ms: u32,
24601 #[doc = "X Position in NED frame"]
24602 pub x: f32,
24603 #[doc = "Y Position in NED frame"]
24604 pub y: f32,
24605 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24606 pub z: f32,
24607 #[doc = "X velocity in NED frame"]
24608 pub vx: f32,
24609 #[doc = "Y velocity in NED frame"]
24610 pub vy: f32,
24611 #[doc = "Z velocity in NED frame"]
24612 pub vz: f32,
24613 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24614 pub afx: f32,
24615 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24616 pub afy: f32,
24617 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24618 pub afz: f32,
24619 #[doc = "yaw setpoint"]
24620 pub yaw: f32,
24621 #[doc = "yaw rate setpoint"]
24622 pub yaw_rate: f32,
24623 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24624 pub type_mask: PositionTargetTypemask,
24625 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24626 pub coordinate_frame: MavFrame,
24627}
24628impl POSITION_TARGET_LOCAL_NED_DATA {
24629 pub const ENCODED_LEN: usize = 51usize;
24630 pub const DEFAULT: Self = Self {
24631 time_boot_ms: 0_u32,
24632 x: 0.0_f32,
24633 y: 0.0_f32,
24634 z: 0.0_f32,
24635 vx: 0.0_f32,
24636 vy: 0.0_f32,
24637 vz: 0.0_f32,
24638 afx: 0.0_f32,
24639 afy: 0.0_f32,
24640 afz: 0.0_f32,
24641 yaw: 0.0_f32,
24642 yaw_rate: 0.0_f32,
24643 type_mask: PositionTargetTypemask::DEFAULT,
24644 coordinate_frame: MavFrame::DEFAULT,
24645 };
24646 #[cfg(feature = "arbitrary")]
24647 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24648 use arbitrary::{Arbitrary, Unstructured};
24649 let mut buf = [0u8; 1024];
24650 rng.fill_bytes(&mut buf);
24651 let mut unstructured = Unstructured::new(&buf);
24652 Self::arbitrary(&mut unstructured).unwrap_or_default()
24653 }
24654}
24655impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24656 fn default() -> Self {
24657 Self::DEFAULT.clone()
24658 }
24659}
24660impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24661 type Message = MavMessage;
24662 const ID: u32 = 85u32;
24663 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24664 const EXTRA_CRC: u8 = 140u8;
24665 const ENCODED_LEN: usize = 51usize;
24666 fn deser(
24667 _version: MavlinkVersion,
24668 __input: &[u8],
24669 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24670 let avail_len = __input.len();
24671 let mut payload_buf = [0; Self::ENCODED_LEN];
24672 let mut buf = if avail_len < Self::ENCODED_LEN {
24673 payload_buf[0..avail_len].copy_from_slice(__input);
24674 Bytes::new(&payload_buf)
24675 } else {
24676 Bytes::new(__input)
24677 };
24678 let mut __struct = Self::default();
24679 __struct.time_boot_ms = buf.get_u32_le();
24680 __struct.x = buf.get_f32_le();
24681 __struct.y = buf.get_f32_le();
24682 __struct.z = buf.get_f32_le();
24683 __struct.vx = buf.get_f32_le();
24684 __struct.vy = buf.get_f32_le();
24685 __struct.vz = buf.get_f32_le();
24686 __struct.afx = buf.get_f32_le();
24687 __struct.afy = buf.get_f32_le();
24688 __struct.afz = buf.get_f32_le();
24689 __struct.yaw = buf.get_f32_le();
24690 __struct.yaw_rate = buf.get_f32_le();
24691 let tmp = buf.get_u16_le();
24692 __struct.type_mask = PositionTargetTypemask::from_bits(
24693 tmp & PositionTargetTypemask::all().bits(),
24694 )
24695 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24696 flag_type: "PositionTargetTypemask",
24697 value: tmp as u32,
24698 })?;
24699 let tmp = buf.get_u8();
24700 __struct.coordinate_frame =
24701 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24702 enum_type: "MavFrame",
24703 value: tmp as u32,
24704 })?;
24705 Ok(__struct)
24706 }
24707 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24708 let mut __tmp = BytesMut::new(bytes);
24709 #[allow(clippy::absurd_extreme_comparisons)]
24710 #[allow(unused_comparisons)]
24711 if __tmp.remaining() < Self::ENCODED_LEN {
24712 panic!(
24713 "buffer is too small (need {} bytes, but got {})",
24714 Self::ENCODED_LEN,
24715 __tmp.remaining(),
24716 )
24717 }
24718 __tmp.put_u32_le(self.time_boot_ms);
24719 __tmp.put_f32_le(self.x);
24720 __tmp.put_f32_le(self.y);
24721 __tmp.put_f32_le(self.z);
24722 __tmp.put_f32_le(self.vx);
24723 __tmp.put_f32_le(self.vy);
24724 __tmp.put_f32_le(self.vz);
24725 __tmp.put_f32_le(self.afx);
24726 __tmp.put_f32_le(self.afy);
24727 __tmp.put_f32_le(self.afz);
24728 __tmp.put_f32_le(self.yaw);
24729 __tmp.put_f32_le(self.yaw_rate);
24730 __tmp.put_u16_le(self.type_mask.bits());
24731 __tmp.put_u8(self.coordinate_frame as u8);
24732 if matches!(version, MavlinkVersion::V2) {
24733 let len = __tmp.len();
24734 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24735 } else {
24736 __tmp.len()
24737 }
24738 }
24739}
24740#[doc = "Power supply status."]
24741#[doc = ""]
24742#[doc = "ID: 125"]
24743#[derive(Debug, Clone, PartialEq)]
24744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24746pub struct POWER_STATUS_DATA {
24747 #[doc = "5V rail voltage."]
24748 pub Vcc: u16,
24749 #[doc = "Servo rail voltage."]
24750 pub Vservo: u16,
24751 #[doc = "Bitmap of power supply status flags."]
24752 pub flags: MavPowerStatus,
24753}
24754impl POWER_STATUS_DATA {
24755 pub const ENCODED_LEN: usize = 6usize;
24756 pub const DEFAULT: Self = Self {
24757 Vcc: 0_u16,
24758 Vservo: 0_u16,
24759 flags: MavPowerStatus::DEFAULT,
24760 };
24761 #[cfg(feature = "arbitrary")]
24762 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24763 use arbitrary::{Arbitrary, Unstructured};
24764 let mut buf = [0u8; 1024];
24765 rng.fill_bytes(&mut buf);
24766 let mut unstructured = Unstructured::new(&buf);
24767 Self::arbitrary(&mut unstructured).unwrap_or_default()
24768 }
24769}
24770impl Default for POWER_STATUS_DATA {
24771 fn default() -> Self {
24772 Self::DEFAULT.clone()
24773 }
24774}
24775impl MessageData for POWER_STATUS_DATA {
24776 type Message = MavMessage;
24777 const ID: u32 = 125u32;
24778 const NAME: &'static str = "POWER_STATUS";
24779 const EXTRA_CRC: u8 = 203u8;
24780 const ENCODED_LEN: usize = 6usize;
24781 fn deser(
24782 _version: MavlinkVersion,
24783 __input: &[u8],
24784 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24785 let avail_len = __input.len();
24786 let mut payload_buf = [0; Self::ENCODED_LEN];
24787 let mut buf = if avail_len < Self::ENCODED_LEN {
24788 payload_buf[0..avail_len].copy_from_slice(__input);
24789 Bytes::new(&payload_buf)
24790 } else {
24791 Bytes::new(__input)
24792 };
24793 let mut __struct = Self::default();
24794 __struct.Vcc = buf.get_u16_le();
24795 __struct.Vservo = buf.get_u16_le();
24796 let tmp = buf.get_u16_le();
24797 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
24798 ::mavlink_core::error::ParserError::InvalidFlag {
24799 flag_type: "MavPowerStatus",
24800 value: tmp as u32,
24801 },
24802 )?;
24803 Ok(__struct)
24804 }
24805 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24806 let mut __tmp = BytesMut::new(bytes);
24807 #[allow(clippy::absurd_extreme_comparisons)]
24808 #[allow(unused_comparisons)]
24809 if __tmp.remaining() < Self::ENCODED_LEN {
24810 panic!(
24811 "buffer is too small (need {} bytes, but got {})",
24812 Self::ENCODED_LEN,
24813 __tmp.remaining(),
24814 )
24815 }
24816 __tmp.put_u16_le(self.Vcc);
24817 __tmp.put_u16_le(self.Vservo);
24818 __tmp.put_u16_le(self.flags.bits());
24819 if matches!(version, MavlinkVersion::V2) {
24820 let len = __tmp.len();
24821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24822 } else {
24823 __tmp.len()
24824 }
24825 }
24826}
24827#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24828#[doc = ""]
24829#[doc = "ID: 300"]
24830#[derive(Debug, Clone, PartialEq)]
24831#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24832#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24833pub struct PROTOCOL_VERSION_DATA {
24834 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24835 pub version: u16,
24836 #[doc = "Minimum MAVLink version supported"]
24837 pub min_version: u16,
24838 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24839 pub max_version: u16,
24840 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24841 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24842 pub spec_version_hash: [u8; 8],
24843 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24844 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24845 pub library_version_hash: [u8; 8],
24846}
24847impl PROTOCOL_VERSION_DATA {
24848 pub const ENCODED_LEN: usize = 22usize;
24849 pub const DEFAULT: Self = Self {
24850 version: 0_u16,
24851 min_version: 0_u16,
24852 max_version: 0_u16,
24853 spec_version_hash: [0_u8; 8usize],
24854 library_version_hash: [0_u8; 8usize],
24855 };
24856 #[cfg(feature = "arbitrary")]
24857 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24858 use arbitrary::{Arbitrary, Unstructured};
24859 let mut buf = [0u8; 1024];
24860 rng.fill_bytes(&mut buf);
24861 let mut unstructured = Unstructured::new(&buf);
24862 Self::arbitrary(&mut unstructured).unwrap_or_default()
24863 }
24864}
24865impl Default for PROTOCOL_VERSION_DATA {
24866 fn default() -> Self {
24867 Self::DEFAULT.clone()
24868 }
24869}
24870impl MessageData for PROTOCOL_VERSION_DATA {
24871 type Message = MavMessage;
24872 const ID: u32 = 300u32;
24873 const NAME: &'static str = "PROTOCOL_VERSION";
24874 const EXTRA_CRC: u8 = 217u8;
24875 const ENCODED_LEN: usize = 22usize;
24876 fn deser(
24877 _version: MavlinkVersion,
24878 __input: &[u8],
24879 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24880 let avail_len = __input.len();
24881 let mut payload_buf = [0; Self::ENCODED_LEN];
24882 let mut buf = if avail_len < Self::ENCODED_LEN {
24883 payload_buf[0..avail_len].copy_from_slice(__input);
24884 Bytes::new(&payload_buf)
24885 } else {
24886 Bytes::new(__input)
24887 };
24888 let mut __struct = Self::default();
24889 __struct.version = buf.get_u16_le();
24890 __struct.min_version = buf.get_u16_le();
24891 __struct.max_version = buf.get_u16_le();
24892 for v in &mut __struct.spec_version_hash {
24893 let val = buf.get_u8();
24894 *v = val;
24895 }
24896 for v in &mut __struct.library_version_hash {
24897 let val = buf.get_u8();
24898 *v = val;
24899 }
24900 Ok(__struct)
24901 }
24902 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24903 let mut __tmp = BytesMut::new(bytes);
24904 #[allow(clippy::absurd_extreme_comparisons)]
24905 #[allow(unused_comparisons)]
24906 if __tmp.remaining() < Self::ENCODED_LEN {
24907 panic!(
24908 "buffer is too small (need {} bytes, but got {})",
24909 Self::ENCODED_LEN,
24910 __tmp.remaining(),
24911 )
24912 }
24913 __tmp.put_u16_le(self.version);
24914 __tmp.put_u16_le(self.min_version);
24915 __tmp.put_u16_le(self.max_version);
24916 for val in &self.spec_version_hash {
24917 __tmp.put_u8(*val);
24918 }
24919 for val in &self.library_version_hash {
24920 __tmp.put_u8(*val);
24921 }
24922 if matches!(version, MavlinkVersion::V2) {
24923 let len = __tmp.len();
24924 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24925 } else {
24926 __tmp.len()
24927 }
24928 }
24929}
24930#[doc = "Status generated by radio and injected into MAVLink stream."]
24931#[doc = ""]
24932#[doc = "ID: 109"]
24933#[derive(Debug, Clone, PartialEq)]
24934#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24935#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24936pub struct RADIO_STATUS_DATA {
24937 #[doc = "Count of radio packet receive errors (since boot)."]
24938 pub rxerrors: u16,
24939 #[doc = "Count of error corrected radio packets (since boot)."]
24940 pub fixed: u16,
24941 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24942 pub rssi: u8,
24943 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24944 pub remrssi: u8,
24945 #[doc = "Remaining free transmitter buffer space."]
24946 pub txbuf: u8,
24947 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24948 pub noise: u8,
24949 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24950 pub remnoise: u8,
24951}
24952impl RADIO_STATUS_DATA {
24953 pub const ENCODED_LEN: usize = 9usize;
24954 pub const DEFAULT: Self = Self {
24955 rxerrors: 0_u16,
24956 fixed: 0_u16,
24957 rssi: 0_u8,
24958 remrssi: 0_u8,
24959 txbuf: 0_u8,
24960 noise: 0_u8,
24961 remnoise: 0_u8,
24962 };
24963 #[cfg(feature = "arbitrary")]
24964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24965 use arbitrary::{Arbitrary, Unstructured};
24966 let mut buf = [0u8; 1024];
24967 rng.fill_bytes(&mut buf);
24968 let mut unstructured = Unstructured::new(&buf);
24969 Self::arbitrary(&mut unstructured).unwrap_or_default()
24970 }
24971}
24972impl Default for RADIO_STATUS_DATA {
24973 fn default() -> Self {
24974 Self::DEFAULT.clone()
24975 }
24976}
24977impl MessageData for RADIO_STATUS_DATA {
24978 type Message = MavMessage;
24979 const ID: u32 = 109u32;
24980 const NAME: &'static str = "RADIO_STATUS";
24981 const EXTRA_CRC: u8 = 185u8;
24982 const ENCODED_LEN: usize = 9usize;
24983 fn deser(
24984 _version: MavlinkVersion,
24985 __input: &[u8],
24986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24987 let avail_len = __input.len();
24988 let mut payload_buf = [0; Self::ENCODED_LEN];
24989 let mut buf = if avail_len < Self::ENCODED_LEN {
24990 payload_buf[0..avail_len].copy_from_slice(__input);
24991 Bytes::new(&payload_buf)
24992 } else {
24993 Bytes::new(__input)
24994 };
24995 let mut __struct = Self::default();
24996 __struct.rxerrors = buf.get_u16_le();
24997 __struct.fixed = buf.get_u16_le();
24998 __struct.rssi = buf.get_u8();
24999 __struct.remrssi = buf.get_u8();
25000 __struct.txbuf = buf.get_u8();
25001 __struct.noise = buf.get_u8();
25002 __struct.remnoise = buf.get_u8();
25003 Ok(__struct)
25004 }
25005 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25006 let mut __tmp = BytesMut::new(bytes);
25007 #[allow(clippy::absurd_extreme_comparisons)]
25008 #[allow(unused_comparisons)]
25009 if __tmp.remaining() < Self::ENCODED_LEN {
25010 panic!(
25011 "buffer is too small (need {} bytes, but got {})",
25012 Self::ENCODED_LEN,
25013 __tmp.remaining(),
25014 )
25015 }
25016 __tmp.put_u16_le(self.rxerrors);
25017 __tmp.put_u16_le(self.fixed);
25018 __tmp.put_u8(self.rssi);
25019 __tmp.put_u8(self.remrssi);
25020 __tmp.put_u8(self.txbuf);
25021 __tmp.put_u8(self.noise);
25022 __tmp.put_u8(self.remnoise);
25023 if matches!(version, MavlinkVersion::V2) {
25024 let len = __tmp.len();
25025 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25026 } else {
25027 __tmp.len()
25028 }
25029 }
25030}
25031#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25032#[doc = ""]
25033#[doc = "ID: 27"]
25034#[derive(Debug, Clone, PartialEq)]
25035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25037pub struct RAW_IMU_DATA {
25038 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25039 pub time_usec: u64,
25040 #[doc = "X acceleration (raw)"]
25041 pub xacc: i16,
25042 #[doc = "Y acceleration (raw)"]
25043 pub yacc: i16,
25044 #[doc = "Z acceleration (raw)"]
25045 pub zacc: i16,
25046 #[doc = "Angular speed around X axis (raw)"]
25047 pub xgyro: i16,
25048 #[doc = "Angular speed around Y axis (raw)"]
25049 pub ygyro: i16,
25050 #[doc = "Angular speed around Z axis (raw)"]
25051 pub zgyro: i16,
25052 #[doc = "X Magnetic field (raw)"]
25053 pub xmag: i16,
25054 #[doc = "Y Magnetic field (raw)"]
25055 pub ymag: i16,
25056 #[doc = "Z Magnetic field (raw)"]
25057 pub zmag: i16,
25058 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25059 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25060 pub id: u8,
25061 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25062 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25063 pub temperature: i16,
25064}
25065impl RAW_IMU_DATA {
25066 pub const ENCODED_LEN: usize = 29usize;
25067 pub const DEFAULT: Self = Self {
25068 time_usec: 0_u64,
25069 xacc: 0_i16,
25070 yacc: 0_i16,
25071 zacc: 0_i16,
25072 xgyro: 0_i16,
25073 ygyro: 0_i16,
25074 zgyro: 0_i16,
25075 xmag: 0_i16,
25076 ymag: 0_i16,
25077 zmag: 0_i16,
25078 id: 0_u8,
25079 temperature: 0_i16,
25080 };
25081 #[cfg(feature = "arbitrary")]
25082 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25083 use arbitrary::{Arbitrary, Unstructured};
25084 let mut buf = [0u8; 1024];
25085 rng.fill_bytes(&mut buf);
25086 let mut unstructured = Unstructured::new(&buf);
25087 Self::arbitrary(&mut unstructured).unwrap_or_default()
25088 }
25089}
25090impl Default for RAW_IMU_DATA {
25091 fn default() -> Self {
25092 Self::DEFAULT.clone()
25093 }
25094}
25095impl MessageData for RAW_IMU_DATA {
25096 type Message = MavMessage;
25097 const ID: u32 = 27u32;
25098 const NAME: &'static str = "RAW_IMU";
25099 const EXTRA_CRC: u8 = 144u8;
25100 const ENCODED_LEN: usize = 29usize;
25101 fn deser(
25102 _version: MavlinkVersion,
25103 __input: &[u8],
25104 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25105 let avail_len = __input.len();
25106 let mut payload_buf = [0; Self::ENCODED_LEN];
25107 let mut buf = if avail_len < Self::ENCODED_LEN {
25108 payload_buf[0..avail_len].copy_from_slice(__input);
25109 Bytes::new(&payload_buf)
25110 } else {
25111 Bytes::new(__input)
25112 };
25113 let mut __struct = Self::default();
25114 __struct.time_usec = buf.get_u64_le();
25115 __struct.xacc = buf.get_i16_le();
25116 __struct.yacc = buf.get_i16_le();
25117 __struct.zacc = buf.get_i16_le();
25118 __struct.xgyro = buf.get_i16_le();
25119 __struct.ygyro = buf.get_i16_le();
25120 __struct.zgyro = buf.get_i16_le();
25121 __struct.xmag = buf.get_i16_le();
25122 __struct.ymag = buf.get_i16_le();
25123 __struct.zmag = buf.get_i16_le();
25124 __struct.id = buf.get_u8();
25125 __struct.temperature = buf.get_i16_le();
25126 Ok(__struct)
25127 }
25128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25129 let mut __tmp = BytesMut::new(bytes);
25130 #[allow(clippy::absurd_extreme_comparisons)]
25131 #[allow(unused_comparisons)]
25132 if __tmp.remaining() < Self::ENCODED_LEN {
25133 panic!(
25134 "buffer is too small (need {} bytes, but got {})",
25135 Self::ENCODED_LEN,
25136 __tmp.remaining(),
25137 )
25138 }
25139 __tmp.put_u64_le(self.time_usec);
25140 __tmp.put_i16_le(self.xacc);
25141 __tmp.put_i16_le(self.yacc);
25142 __tmp.put_i16_le(self.zacc);
25143 __tmp.put_i16_le(self.xgyro);
25144 __tmp.put_i16_le(self.ygyro);
25145 __tmp.put_i16_le(self.zgyro);
25146 __tmp.put_i16_le(self.xmag);
25147 __tmp.put_i16_le(self.ymag);
25148 __tmp.put_i16_le(self.zmag);
25149 if matches!(version, MavlinkVersion::V2) {
25150 __tmp.put_u8(self.id);
25151 __tmp.put_i16_le(self.temperature);
25152 let len = __tmp.len();
25153 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25154 } else {
25155 __tmp.len()
25156 }
25157 }
25158}
25159#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25160#[doc = ""]
25161#[doc = "ID: 28"]
25162#[derive(Debug, Clone, PartialEq)]
25163#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25165pub struct RAW_PRESSURE_DATA {
25166 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25167 pub time_usec: u64,
25168 #[doc = "Absolute pressure (raw)"]
25169 pub press_abs: i16,
25170 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25171 pub press_diff1: i16,
25172 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25173 pub press_diff2: i16,
25174 #[doc = "Raw Temperature measurement (raw)"]
25175 pub temperature: i16,
25176}
25177impl RAW_PRESSURE_DATA {
25178 pub const ENCODED_LEN: usize = 16usize;
25179 pub const DEFAULT: Self = Self {
25180 time_usec: 0_u64,
25181 press_abs: 0_i16,
25182 press_diff1: 0_i16,
25183 press_diff2: 0_i16,
25184 temperature: 0_i16,
25185 };
25186 #[cfg(feature = "arbitrary")]
25187 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25188 use arbitrary::{Arbitrary, Unstructured};
25189 let mut buf = [0u8; 1024];
25190 rng.fill_bytes(&mut buf);
25191 let mut unstructured = Unstructured::new(&buf);
25192 Self::arbitrary(&mut unstructured).unwrap_or_default()
25193 }
25194}
25195impl Default for RAW_PRESSURE_DATA {
25196 fn default() -> Self {
25197 Self::DEFAULT.clone()
25198 }
25199}
25200impl MessageData for RAW_PRESSURE_DATA {
25201 type Message = MavMessage;
25202 const ID: u32 = 28u32;
25203 const NAME: &'static str = "RAW_PRESSURE";
25204 const EXTRA_CRC: u8 = 67u8;
25205 const ENCODED_LEN: usize = 16usize;
25206 fn deser(
25207 _version: MavlinkVersion,
25208 __input: &[u8],
25209 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25210 let avail_len = __input.len();
25211 let mut payload_buf = [0; Self::ENCODED_LEN];
25212 let mut buf = if avail_len < Self::ENCODED_LEN {
25213 payload_buf[0..avail_len].copy_from_slice(__input);
25214 Bytes::new(&payload_buf)
25215 } else {
25216 Bytes::new(__input)
25217 };
25218 let mut __struct = Self::default();
25219 __struct.time_usec = buf.get_u64_le();
25220 __struct.press_abs = buf.get_i16_le();
25221 __struct.press_diff1 = buf.get_i16_le();
25222 __struct.press_diff2 = buf.get_i16_le();
25223 __struct.temperature = buf.get_i16_le();
25224 Ok(__struct)
25225 }
25226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25227 let mut __tmp = BytesMut::new(bytes);
25228 #[allow(clippy::absurd_extreme_comparisons)]
25229 #[allow(unused_comparisons)]
25230 if __tmp.remaining() < Self::ENCODED_LEN {
25231 panic!(
25232 "buffer is too small (need {} bytes, but got {})",
25233 Self::ENCODED_LEN,
25234 __tmp.remaining(),
25235 )
25236 }
25237 __tmp.put_u64_le(self.time_usec);
25238 __tmp.put_i16_le(self.press_abs);
25239 __tmp.put_i16_le(self.press_diff1);
25240 __tmp.put_i16_le(self.press_diff2);
25241 __tmp.put_i16_le(self.temperature);
25242 if matches!(version, MavlinkVersion::V2) {
25243 let len = __tmp.len();
25244 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25245 } else {
25246 __tmp.len()
25247 }
25248 }
25249}
25250#[doc = "RPM sensor data message."]
25251#[doc = ""]
25252#[doc = "ID: 339"]
25253#[derive(Debug, Clone, PartialEq)]
25254#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25256pub struct RAW_RPM_DATA {
25257 #[doc = "Indicated rate"]
25258 pub frequency: f32,
25259 #[doc = "Index of this RPM sensor (0-indexed)"]
25260 pub index: u8,
25261}
25262impl RAW_RPM_DATA {
25263 pub const ENCODED_LEN: usize = 5usize;
25264 pub const DEFAULT: Self = Self {
25265 frequency: 0.0_f32,
25266 index: 0_u8,
25267 };
25268 #[cfg(feature = "arbitrary")]
25269 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25270 use arbitrary::{Arbitrary, Unstructured};
25271 let mut buf = [0u8; 1024];
25272 rng.fill_bytes(&mut buf);
25273 let mut unstructured = Unstructured::new(&buf);
25274 Self::arbitrary(&mut unstructured).unwrap_or_default()
25275 }
25276}
25277impl Default for RAW_RPM_DATA {
25278 fn default() -> Self {
25279 Self::DEFAULT.clone()
25280 }
25281}
25282impl MessageData for RAW_RPM_DATA {
25283 type Message = MavMessage;
25284 const ID: u32 = 339u32;
25285 const NAME: &'static str = "RAW_RPM";
25286 const EXTRA_CRC: u8 = 199u8;
25287 const ENCODED_LEN: usize = 5usize;
25288 fn deser(
25289 _version: MavlinkVersion,
25290 __input: &[u8],
25291 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25292 let avail_len = __input.len();
25293 let mut payload_buf = [0; Self::ENCODED_LEN];
25294 let mut buf = if avail_len < Self::ENCODED_LEN {
25295 payload_buf[0..avail_len].copy_from_slice(__input);
25296 Bytes::new(&payload_buf)
25297 } else {
25298 Bytes::new(__input)
25299 };
25300 let mut __struct = Self::default();
25301 __struct.frequency = buf.get_f32_le();
25302 __struct.index = buf.get_u8();
25303 Ok(__struct)
25304 }
25305 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25306 let mut __tmp = BytesMut::new(bytes);
25307 #[allow(clippy::absurd_extreme_comparisons)]
25308 #[allow(unused_comparisons)]
25309 if __tmp.remaining() < Self::ENCODED_LEN {
25310 panic!(
25311 "buffer is too small (need {} bytes, but got {})",
25312 Self::ENCODED_LEN,
25313 __tmp.remaining(),
25314 )
25315 }
25316 __tmp.put_f32_le(self.frequency);
25317 __tmp.put_u8(self.index);
25318 if matches!(version, MavlinkVersion::V2) {
25319 let len = __tmp.len();
25320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25321 } else {
25322 __tmp.len()
25323 }
25324 }
25325}
25326#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25327#[doc = ""]
25328#[doc = "ID: 65"]
25329#[derive(Debug, Clone, PartialEq)]
25330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25332pub struct RC_CHANNELS_DATA {
25333 #[doc = "Timestamp (time since system boot)."]
25334 pub time_boot_ms: u32,
25335 #[doc = "RC channel 1 value."]
25336 pub chan1_raw: u16,
25337 #[doc = "RC channel 2 value."]
25338 pub chan2_raw: u16,
25339 #[doc = "RC channel 3 value."]
25340 pub chan3_raw: u16,
25341 #[doc = "RC channel 4 value."]
25342 pub chan4_raw: u16,
25343 #[doc = "RC channel 5 value."]
25344 pub chan5_raw: u16,
25345 #[doc = "RC channel 6 value."]
25346 pub chan6_raw: u16,
25347 #[doc = "RC channel 7 value."]
25348 pub chan7_raw: u16,
25349 #[doc = "RC channel 8 value."]
25350 pub chan8_raw: u16,
25351 #[doc = "RC channel 9 value."]
25352 pub chan9_raw: u16,
25353 #[doc = "RC channel 10 value."]
25354 pub chan10_raw: u16,
25355 #[doc = "RC channel 11 value."]
25356 pub chan11_raw: u16,
25357 #[doc = "RC channel 12 value."]
25358 pub chan12_raw: u16,
25359 #[doc = "RC channel 13 value."]
25360 pub chan13_raw: u16,
25361 #[doc = "RC channel 14 value."]
25362 pub chan14_raw: u16,
25363 #[doc = "RC channel 15 value."]
25364 pub chan15_raw: u16,
25365 #[doc = "RC channel 16 value."]
25366 pub chan16_raw: u16,
25367 #[doc = "RC channel 17 value."]
25368 pub chan17_raw: u16,
25369 #[doc = "RC channel 18 value."]
25370 pub chan18_raw: u16,
25371 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25372 pub chancount: u8,
25373 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25374 pub rssi: u8,
25375}
25376impl RC_CHANNELS_DATA {
25377 pub const ENCODED_LEN: usize = 42usize;
25378 pub const DEFAULT: Self = Self {
25379 time_boot_ms: 0_u32,
25380 chan1_raw: 0_u16,
25381 chan2_raw: 0_u16,
25382 chan3_raw: 0_u16,
25383 chan4_raw: 0_u16,
25384 chan5_raw: 0_u16,
25385 chan6_raw: 0_u16,
25386 chan7_raw: 0_u16,
25387 chan8_raw: 0_u16,
25388 chan9_raw: 0_u16,
25389 chan10_raw: 0_u16,
25390 chan11_raw: 0_u16,
25391 chan12_raw: 0_u16,
25392 chan13_raw: 0_u16,
25393 chan14_raw: 0_u16,
25394 chan15_raw: 0_u16,
25395 chan16_raw: 0_u16,
25396 chan17_raw: 0_u16,
25397 chan18_raw: 0_u16,
25398 chancount: 0_u8,
25399 rssi: 0_u8,
25400 };
25401 #[cfg(feature = "arbitrary")]
25402 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25403 use arbitrary::{Arbitrary, Unstructured};
25404 let mut buf = [0u8; 1024];
25405 rng.fill_bytes(&mut buf);
25406 let mut unstructured = Unstructured::new(&buf);
25407 Self::arbitrary(&mut unstructured).unwrap_or_default()
25408 }
25409}
25410impl Default for RC_CHANNELS_DATA {
25411 fn default() -> Self {
25412 Self::DEFAULT.clone()
25413 }
25414}
25415impl MessageData for RC_CHANNELS_DATA {
25416 type Message = MavMessage;
25417 const ID: u32 = 65u32;
25418 const NAME: &'static str = "RC_CHANNELS";
25419 const EXTRA_CRC: u8 = 118u8;
25420 const ENCODED_LEN: usize = 42usize;
25421 fn deser(
25422 _version: MavlinkVersion,
25423 __input: &[u8],
25424 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25425 let avail_len = __input.len();
25426 let mut payload_buf = [0; Self::ENCODED_LEN];
25427 let mut buf = if avail_len < Self::ENCODED_LEN {
25428 payload_buf[0..avail_len].copy_from_slice(__input);
25429 Bytes::new(&payload_buf)
25430 } else {
25431 Bytes::new(__input)
25432 };
25433 let mut __struct = Self::default();
25434 __struct.time_boot_ms = buf.get_u32_le();
25435 __struct.chan1_raw = buf.get_u16_le();
25436 __struct.chan2_raw = buf.get_u16_le();
25437 __struct.chan3_raw = buf.get_u16_le();
25438 __struct.chan4_raw = buf.get_u16_le();
25439 __struct.chan5_raw = buf.get_u16_le();
25440 __struct.chan6_raw = buf.get_u16_le();
25441 __struct.chan7_raw = buf.get_u16_le();
25442 __struct.chan8_raw = buf.get_u16_le();
25443 __struct.chan9_raw = buf.get_u16_le();
25444 __struct.chan10_raw = buf.get_u16_le();
25445 __struct.chan11_raw = buf.get_u16_le();
25446 __struct.chan12_raw = buf.get_u16_le();
25447 __struct.chan13_raw = buf.get_u16_le();
25448 __struct.chan14_raw = buf.get_u16_le();
25449 __struct.chan15_raw = buf.get_u16_le();
25450 __struct.chan16_raw = buf.get_u16_le();
25451 __struct.chan17_raw = buf.get_u16_le();
25452 __struct.chan18_raw = buf.get_u16_le();
25453 __struct.chancount = buf.get_u8();
25454 __struct.rssi = buf.get_u8();
25455 Ok(__struct)
25456 }
25457 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25458 let mut __tmp = BytesMut::new(bytes);
25459 #[allow(clippy::absurd_extreme_comparisons)]
25460 #[allow(unused_comparisons)]
25461 if __tmp.remaining() < Self::ENCODED_LEN {
25462 panic!(
25463 "buffer is too small (need {} bytes, but got {})",
25464 Self::ENCODED_LEN,
25465 __tmp.remaining(),
25466 )
25467 }
25468 __tmp.put_u32_le(self.time_boot_ms);
25469 __tmp.put_u16_le(self.chan1_raw);
25470 __tmp.put_u16_le(self.chan2_raw);
25471 __tmp.put_u16_le(self.chan3_raw);
25472 __tmp.put_u16_le(self.chan4_raw);
25473 __tmp.put_u16_le(self.chan5_raw);
25474 __tmp.put_u16_le(self.chan6_raw);
25475 __tmp.put_u16_le(self.chan7_raw);
25476 __tmp.put_u16_le(self.chan8_raw);
25477 __tmp.put_u16_le(self.chan9_raw);
25478 __tmp.put_u16_le(self.chan10_raw);
25479 __tmp.put_u16_le(self.chan11_raw);
25480 __tmp.put_u16_le(self.chan12_raw);
25481 __tmp.put_u16_le(self.chan13_raw);
25482 __tmp.put_u16_le(self.chan14_raw);
25483 __tmp.put_u16_le(self.chan15_raw);
25484 __tmp.put_u16_le(self.chan16_raw);
25485 __tmp.put_u16_le(self.chan17_raw);
25486 __tmp.put_u16_le(self.chan18_raw);
25487 __tmp.put_u8(self.chancount);
25488 __tmp.put_u8(self.rssi);
25489 if matches!(version, MavlinkVersion::V2) {
25490 let len = __tmp.len();
25491 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25492 } else {
25493 __tmp.len()
25494 }
25495 }
25496}
25497#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25498#[doc = ""]
25499#[doc = "ID: 70"]
25500#[derive(Debug, Clone, PartialEq)]
25501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25503pub struct RC_CHANNELS_OVERRIDE_DATA {
25504 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25505 pub chan1_raw: u16,
25506 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25507 pub chan2_raw: u16,
25508 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25509 pub chan3_raw: u16,
25510 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25511 pub chan4_raw: u16,
25512 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25513 pub chan5_raw: u16,
25514 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25515 pub chan6_raw: u16,
25516 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25517 pub chan7_raw: u16,
25518 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25519 pub chan8_raw: u16,
25520 #[doc = "System ID"]
25521 pub target_system: u8,
25522 #[doc = "Component ID"]
25523 pub target_component: u8,
25524 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25525 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25526 pub chan9_raw: u16,
25527 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25528 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25529 pub chan10_raw: u16,
25530 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25531 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25532 pub chan11_raw: u16,
25533 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25534 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25535 pub chan12_raw: u16,
25536 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25537 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25538 pub chan13_raw: u16,
25539 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25540 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25541 pub chan14_raw: u16,
25542 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25543 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25544 pub chan15_raw: u16,
25545 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25546 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25547 pub chan16_raw: u16,
25548 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25549 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25550 pub chan17_raw: u16,
25551 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25552 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25553 pub chan18_raw: u16,
25554}
25555impl RC_CHANNELS_OVERRIDE_DATA {
25556 pub const ENCODED_LEN: usize = 38usize;
25557 pub const DEFAULT: Self = Self {
25558 chan1_raw: 0_u16,
25559 chan2_raw: 0_u16,
25560 chan3_raw: 0_u16,
25561 chan4_raw: 0_u16,
25562 chan5_raw: 0_u16,
25563 chan6_raw: 0_u16,
25564 chan7_raw: 0_u16,
25565 chan8_raw: 0_u16,
25566 target_system: 0_u8,
25567 target_component: 0_u8,
25568 chan9_raw: 0_u16,
25569 chan10_raw: 0_u16,
25570 chan11_raw: 0_u16,
25571 chan12_raw: 0_u16,
25572 chan13_raw: 0_u16,
25573 chan14_raw: 0_u16,
25574 chan15_raw: 0_u16,
25575 chan16_raw: 0_u16,
25576 chan17_raw: 0_u16,
25577 chan18_raw: 0_u16,
25578 };
25579 #[cfg(feature = "arbitrary")]
25580 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25581 use arbitrary::{Arbitrary, Unstructured};
25582 let mut buf = [0u8; 1024];
25583 rng.fill_bytes(&mut buf);
25584 let mut unstructured = Unstructured::new(&buf);
25585 Self::arbitrary(&mut unstructured).unwrap_or_default()
25586 }
25587}
25588impl Default for RC_CHANNELS_OVERRIDE_DATA {
25589 fn default() -> Self {
25590 Self::DEFAULT.clone()
25591 }
25592}
25593impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25594 type Message = MavMessage;
25595 const ID: u32 = 70u32;
25596 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25597 const EXTRA_CRC: u8 = 124u8;
25598 const ENCODED_LEN: usize = 38usize;
25599 fn deser(
25600 _version: MavlinkVersion,
25601 __input: &[u8],
25602 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25603 let avail_len = __input.len();
25604 let mut payload_buf = [0; Self::ENCODED_LEN];
25605 let mut buf = if avail_len < Self::ENCODED_LEN {
25606 payload_buf[0..avail_len].copy_from_slice(__input);
25607 Bytes::new(&payload_buf)
25608 } else {
25609 Bytes::new(__input)
25610 };
25611 let mut __struct = Self::default();
25612 __struct.chan1_raw = buf.get_u16_le();
25613 __struct.chan2_raw = buf.get_u16_le();
25614 __struct.chan3_raw = buf.get_u16_le();
25615 __struct.chan4_raw = buf.get_u16_le();
25616 __struct.chan5_raw = buf.get_u16_le();
25617 __struct.chan6_raw = buf.get_u16_le();
25618 __struct.chan7_raw = buf.get_u16_le();
25619 __struct.chan8_raw = buf.get_u16_le();
25620 __struct.target_system = buf.get_u8();
25621 __struct.target_component = buf.get_u8();
25622 __struct.chan9_raw = buf.get_u16_le();
25623 __struct.chan10_raw = buf.get_u16_le();
25624 __struct.chan11_raw = buf.get_u16_le();
25625 __struct.chan12_raw = buf.get_u16_le();
25626 __struct.chan13_raw = buf.get_u16_le();
25627 __struct.chan14_raw = buf.get_u16_le();
25628 __struct.chan15_raw = buf.get_u16_le();
25629 __struct.chan16_raw = buf.get_u16_le();
25630 __struct.chan17_raw = buf.get_u16_le();
25631 __struct.chan18_raw = buf.get_u16_le();
25632 Ok(__struct)
25633 }
25634 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25635 let mut __tmp = BytesMut::new(bytes);
25636 #[allow(clippy::absurd_extreme_comparisons)]
25637 #[allow(unused_comparisons)]
25638 if __tmp.remaining() < Self::ENCODED_LEN {
25639 panic!(
25640 "buffer is too small (need {} bytes, but got {})",
25641 Self::ENCODED_LEN,
25642 __tmp.remaining(),
25643 )
25644 }
25645 __tmp.put_u16_le(self.chan1_raw);
25646 __tmp.put_u16_le(self.chan2_raw);
25647 __tmp.put_u16_le(self.chan3_raw);
25648 __tmp.put_u16_le(self.chan4_raw);
25649 __tmp.put_u16_le(self.chan5_raw);
25650 __tmp.put_u16_le(self.chan6_raw);
25651 __tmp.put_u16_le(self.chan7_raw);
25652 __tmp.put_u16_le(self.chan8_raw);
25653 __tmp.put_u8(self.target_system);
25654 __tmp.put_u8(self.target_component);
25655 if matches!(version, MavlinkVersion::V2) {
25656 __tmp.put_u16_le(self.chan9_raw);
25657 __tmp.put_u16_le(self.chan10_raw);
25658 __tmp.put_u16_le(self.chan11_raw);
25659 __tmp.put_u16_le(self.chan12_raw);
25660 __tmp.put_u16_le(self.chan13_raw);
25661 __tmp.put_u16_le(self.chan14_raw);
25662 __tmp.put_u16_le(self.chan15_raw);
25663 __tmp.put_u16_le(self.chan16_raw);
25664 __tmp.put_u16_le(self.chan17_raw);
25665 __tmp.put_u16_le(self.chan18_raw);
25666 let len = __tmp.len();
25667 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25668 } else {
25669 __tmp.len()
25670 }
25671 }
25672}
25673#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25674#[doc = ""]
25675#[doc = "ID: 35"]
25676#[derive(Debug, Clone, PartialEq)]
25677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25679pub struct RC_CHANNELS_RAW_DATA {
25680 #[doc = "Timestamp (time since system boot)."]
25681 pub time_boot_ms: u32,
25682 #[doc = "RC channel 1 value."]
25683 pub chan1_raw: u16,
25684 #[doc = "RC channel 2 value."]
25685 pub chan2_raw: u16,
25686 #[doc = "RC channel 3 value."]
25687 pub chan3_raw: u16,
25688 #[doc = "RC channel 4 value."]
25689 pub chan4_raw: u16,
25690 #[doc = "RC channel 5 value."]
25691 pub chan5_raw: u16,
25692 #[doc = "RC channel 6 value."]
25693 pub chan6_raw: u16,
25694 #[doc = "RC channel 7 value."]
25695 pub chan7_raw: u16,
25696 #[doc = "RC channel 8 value."]
25697 pub chan8_raw: u16,
25698 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25699 pub port: u8,
25700 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25701 pub rssi: u8,
25702}
25703impl RC_CHANNELS_RAW_DATA {
25704 pub const ENCODED_LEN: usize = 22usize;
25705 pub const DEFAULT: Self = Self {
25706 time_boot_ms: 0_u32,
25707 chan1_raw: 0_u16,
25708 chan2_raw: 0_u16,
25709 chan3_raw: 0_u16,
25710 chan4_raw: 0_u16,
25711 chan5_raw: 0_u16,
25712 chan6_raw: 0_u16,
25713 chan7_raw: 0_u16,
25714 chan8_raw: 0_u16,
25715 port: 0_u8,
25716 rssi: 0_u8,
25717 };
25718 #[cfg(feature = "arbitrary")]
25719 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25720 use arbitrary::{Arbitrary, Unstructured};
25721 let mut buf = [0u8; 1024];
25722 rng.fill_bytes(&mut buf);
25723 let mut unstructured = Unstructured::new(&buf);
25724 Self::arbitrary(&mut unstructured).unwrap_or_default()
25725 }
25726}
25727impl Default for RC_CHANNELS_RAW_DATA {
25728 fn default() -> Self {
25729 Self::DEFAULT.clone()
25730 }
25731}
25732impl MessageData for RC_CHANNELS_RAW_DATA {
25733 type Message = MavMessage;
25734 const ID: u32 = 35u32;
25735 const NAME: &'static str = "RC_CHANNELS_RAW";
25736 const EXTRA_CRC: u8 = 244u8;
25737 const ENCODED_LEN: usize = 22usize;
25738 fn deser(
25739 _version: MavlinkVersion,
25740 __input: &[u8],
25741 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25742 let avail_len = __input.len();
25743 let mut payload_buf = [0; Self::ENCODED_LEN];
25744 let mut buf = if avail_len < Self::ENCODED_LEN {
25745 payload_buf[0..avail_len].copy_from_slice(__input);
25746 Bytes::new(&payload_buf)
25747 } else {
25748 Bytes::new(__input)
25749 };
25750 let mut __struct = Self::default();
25751 __struct.time_boot_ms = buf.get_u32_le();
25752 __struct.chan1_raw = buf.get_u16_le();
25753 __struct.chan2_raw = buf.get_u16_le();
25754 __struct.chan3_raw = buf.get_u16_le();
25755 __struct.chan4_raw = buf.get_u16_le();
25756 __struct.chan5_raw = buf.get_u16_le();
25757 __struct.chan6_raw = buf.get_u16_le();
25758 __struct.chan7_raw = buf.get_u16_le();
25759 __struct.chan8_raw = buf.get_u16_le();
25760 __struct.port = buf.get_u8();
25761 __struct.rssi = buf.get_u8();
25762 Ok(__struct)
25763 }
25764 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25765 let mut __tmp = BytesMut::new(bytes);
25766 #[allow(clippy::absurd_extreme_comparisons)]
25767 #[allow(unused_comparisons)]
25768 if __tmp.remaining() < Self::ENCODED_LEN {
25769 panic!(
25770 "buffer is too small (need {} bytes, but got {})",
25771 Self::ENCODED_LEN,
25772 __tmp.remaining(),
25773 )
25774 }
25775 __tmp.put_u32_le(self.time_boot_ms);
25776 __tmp.put_u16_le(self.chan1_raw);
25777 __tmp.put_u16_le(self.chan2_raw);
25778 __tmp.put_u16_le(self.chan3_raw);
25779 __tmp.put_u16_le(self.chan4_raw);
25780 __tmp.put_u16_le(self.chan5_raw);
25781 __tmp.put_u16_le(self.chan6_raw);
25782 __tmp.put_u16_le(self.chan7_raw);
25783 __tmp.put_u16_le(self.chan8_raw);
25784 __tmp.put_u8(self.port);
25785 __tmp.put_u8(self.rssi);
25786 if matches!(version, MavlinkVersion::V2) {
25787 let len = __tmp.len();
25788 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25789 } else {
25790 __tmp.len()
25791 }
25792 }
25793}
25794#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25795#[doc = ""]
25796#[doc = "ID: 34"]
25797#[derive(Debug, Clone, PartialEq)]
25798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25800pub struct RC_CHANNELS_SCALED_DATA {
25801 #[doc = "Timestamp (time since system boot)."]
25802 pub time_boot_ms: u32,
25803 #[doc = "RC channel 1 value scaled."]
25804 pub chan1_scaled: i16,
25805 #[doc = "RC channel 2 value scaled."]
25806 pub chan2_scaled: i16,
25807 #[doc = "RC channel 3 value scaled."]
25808 pub chan3_scaled: i16,
25809 #[doc = "RC channel 4 value scaled."]
25810 pub chan4_scaled: i16,
25811 #[doc = "RC channel 5 value scaled."]
25812 pub chan5_scaled: i16,
25813 #[doc = "RC channel 6 value scaled."]
25814 pub chan6_scaled: i16,
25815 #[doc = "RC channel 7 value scaled."]
25816 pub chan7_scaled: i16,
25817 #[doc = "RC channel 8 value scaled."]
25818 pub chan8_scaled: i16,
25819 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25820 pub port: u8,
25821 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25822 pub rssi: u8,
25823}
25824impl RC_CHANNELS_SCALED_DATA {
25825 pub const ENCODED_LEN: usize = 22usize;
25826 pub const DEFAULT: Self = Self {
25827 time_boot_ms: 0_u32,
25828 chan1_scaled: 0_i16,
25829 chan2_scaled: 0_i16,
25830 chan3_scaled: 0_i16,
25831 chan4_scaled: 0_i16,
25832 chan5_scaled: 0_i16,
25833 chan6_scaled: 0_i16,
25834 chan7_scaled: 0_i16,
25835 chan8_scaled: 0_i16,
25836 port: 0_u8,
25837 rssi: 0_u8,
25838 };
25839 #[cfg(feature = "arbitrary")]
25840 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25841 use arbitrary::{Arbitrary, Unstructured};
25842 let mut buf = [0u8; 1024];
25843 rng.fill_bytes(&mut buf);
25844 let mut unstructured = Unstructured::new(&buf);
25845 Self::arbitrary(&mut unstructured).unwrap_or_default()
25846 }
25847}
25848impl Default for RC_CHANNELS_SCALED_DATA {
25849 fn default() -> Self {
25850 Self::DEFAULT.clone()
25851 }
25852}
25853impl MessageData for RC_CHANNELS_SCALED_DATA {
25854 type Message = MavMessage;
25855 const ID: u32 = 34u32;
25856 const NAME: &'static str = "RC_CHANNELS_SCALED";
25857 const EXTRA_CRC: u8 = 237u8;
25858 const ENCODED_LEN: usize = 22usize;
25859 fn deser(
25860 _version: MavlinkVersion,
25861 __input: &[u8],
25862 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25863 let avail_len = __input.len();
25864 let mut payload_buf = [0; Self::ENCODED_LEN];
25865 let mut buf = if avail_len < Self::ENCODED_LEN {
25866 payload_buf[0..avail_len].copy_from_slice(__input);
25867 Bytes::new(&payload_buf)
25868 } else {
25869 Bytes::new(__input)
25870 };
25871 let mut __struct = Self::default();
25872 __struct.time_boot_ms = buf.get_u32_le();
25873 __struct.chan1_scaled = buf.get_i16_le();
25874 __struct.chan2_scaled = buf.get_i16_le();
25875 __struct.chan3_scaled = buf.get_i16_le();
25876 __struct.chan4_scaled = buf.get_i16_le();
25877 __struct.chan5_scaled = buf.get_i16_le();
25878 __struct.chan6_scaled = buf.get_i16_le();
25879 __struct.chan7_scaled = buf.get_i16_le();
25880 __struct.chan8_scaled = buf.get_i16_le();
25881 __struct.port = buf.get_u8();
25882 __struct.rssi = buf.get_u8();
25883 Ok(__struct)
25884 }
25885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25886 let mut __tmp = BytesMut::new(bytes);
25887 #[allow(clippy::absurd_extreme_comparisons)]
25888 #[allow(unused_comparisons)]
25889 if __tmp.remaining() < Self::ENCODED_LEN {
25890 panic!(
25891 "buffer is too small (need {} bytes, but got {})",
25892 Self::ENCODED_LEN,
25893 __tmp.remaining(),
25894 )
25895 }
25896 __tmp.put_u32_le(self.time_boot_ms);
25897 __tmp.put_i16_le(self.chan1_scaled);
25898 __tmp.put_i16_le(self.chan2_scaled);
25899 __tmp.put_i16_le(self.chan3_scaled);
25900 __tmp.put_i16_le(self.chan4_scaled);
25901 __tmp.put_i16_le(self.chan5_scaled);
25902 __tmp.put_i16_le(self.chan6_scaled);
25903 __tmp.put_i16_le(self.chan7_scaled);
25904 __tmp.put_i16_le(self.chan8_scaled);
25905 __tmp.put_u8(self.port);
25906 __tmp.put_u8(self.rssi);
25907 if matches!(version, MavlinkVersion::V2) {
25908 let len = __tmp.len();
25909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25910 } else {
25911 __tmp.len()
25912 }
25913 }
25914}
25915#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
25916#[doc = "Request a data stream."]
25917#[doc = ""]
25918#[doc = "ID: 66"]
25919#[derive(Debug, Clone, PartialEq)]
25920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25922pub struct REQUEST_DATA_STREAM_DATA {
25923 #[doc = "The requested message rate"]
25924 pub req_message_rate: u16,
25925 #[doc = "The target requested to send the message stream."]
25926 pub target_system: u8,
25927 #[doc = "The target requested to send the message stream."]
25928 pub target_component: u8,
25929 #[doc = "The ID of the requested data stream"]
25930 pub req_stream_id: u8,
25931 #[doc = "1 to start sending, 0 to stop sending."]
25932 pub start_stop: u8,
25933}
25934impl REQUEST_DATA_STREAM_DATA {
25935 pub const ENCODED_LEN: usize = 6usize;
25936 pub const DEFAULT: Self = Self {
25937 req_message_rate: 0_u16,
25938 target_system: 0_u8,
25939 target_component: 0_u8,
25940 req_stream_id: 0_u8,
25941 start_stop: 0_u8,
25942 };
25943 #[cfg(feature = "arbitrary")]
25944 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25945 use arbitrary::{Arbitrary, Unstructured};
25946 let mut buf = [0u8; 1024];
25947 rng.fill_bytes(&mut buf);
25948 let mut unstructured = Unstructured::new(&buf);
25949 Self::arbitrary(&mut unstructured).unwrap_or_default()
25950 }
25951}
25952impl Default for REQUEST_DATA_STREAM_DATA {
25953 fn default() -> Self {
25954 Self::DEFAULT.clone()
25955 }
25956}
25957impl MessageData for REQUEST_DATA_STREAM_DATA {
25958 type Message = MavMessage;
25959 const ID: u32 = 66u32;
25960 const NAME: &'static str = "REQUEST_DATA_STREAM";
25961 const EXTRA_CRC: u8 = 148u8;
25962 const ENCODED_LEN: usize = 6usize;
25963 fn deser(
25964 _version: MavlinkVersion,
25965 __input: &[u8],
25966 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25967 let avail_len = __input.len();
25968 let mut payload_buf = [0; Self::ENCODED_LEN];
25969 let mut buf = if avail_len < Self::ENCODED_LEN {
25970 payload_buf[0..avail_len].copy_from_slice(__input);
25971 Bytes::new(&payload_buf)
25972 } else {
25973 Bytes::new(__input)
25974 };
25975 let mut __struct = Self::default();
25976 __struct.req_message_rate = buf.get_u16_le();
25977 __struct.target_system = buf.get_u8();
25978 __struct.target_component = buf.get_u8();
25979 __struct.req_stream_id = buf.get_u8();
25980 __struct.start_stop = buf.get_u8();
25981 Ok(__struct)
25982 }
25983 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25984 let mut __tmp = BytesMut::new(bytes);
25985 #[allow(clippy::absurd_extreme_comparisons)]
25986 #[allow(unused_comparisons)]
25987 if __tmp.remaining() < Self::ENCODED_LEN {
25988 panic!(
25989 "buffer is too small (need {} bytes, but got {})",
25990 Self::ENCODED_LEN,
25991 __tmp.remaining(),
25992 )
25993 }
25994 __tmp.put_u16_le(self.req_message_rate);
25995 __tmp.put_u8(self.target_system);
25996 __tmp.put_u8(self.target_component);
25997 __tmp.put_u8(self.req_stream_id);
25998 __tmp.put_u8(self.start_stop);
25999 if matches!(version, MavlinkVersion::V2) {
26000 let len = __tmp.len();
26001 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26002 } else {
26003 __tmp.len()
26004 }
26005 }
26006}
26007#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26008#[doc = ""]
26009#[doc = "ID: 412"]
26010#[derive(Debug, Clone, PartialEq)]
26011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26013pub struct REQUEST_EVENT_DATA {
26014 #[doc = "First sequence number of the requested event."]
26015 pub first_sequence: u16,
26016 #[doc = "Last sequence number of the requested event."]
26017 pub last_sequence: u16,
26018 #[doc = "System ID"]
26019 pub target_system: u8,
26020 #[doc = "Component ID"]
26021 pub target_component: u8,
26022}
26023impl REQUEST_EVENT_DATA {
26024 pub const ENCODED_LEN: usize = 6usize;
26025 pub const DEFAULT: Self = Self {
26026 first_sequence: 0_u16,
26027 last_sequence: 0_u16,
26028 target_system: 0_u8,
26029 target_component: 0_u8,
26030 };
26031 #[cfg(feature = "arbitrary")]
26032 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26033 use arbitrary::{Arbitrary, Unstructured};
26034 let mut buf = [0u8; 1024];
26035 rng.fill_bytes(&mut buf);
26036 let mut unstructured = Unstructured::new(&buf);
26037 Self::arbitrary(&mut unstructured).unwrap_or_default()
26038 }
26039}
26040impl Default for REQUEST_EVENT_DATA {
26041 fn default() -> Self {
26042 Self::DEFAULT.clone()
26043 }
26044}
26045impl MessageData for REQUEST_EVENT_DATA {
26046 type Message = MavMessage;
26047 const ID: u32 = 412u32;
26048 const NAME: &'static str = "REQUEST_EVENT";
26049 const EXTRA_CRC: u8 = 33u8;
26050 const ENCODED_LEN: usize = 6usize;
26051 fn deser(
26052 _version: MavlinkVersion,
26053 __input: &[u8],
26054 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26055 let avail_len = __input.len();
26056 let mut payload_buf = [0; Self::ENCODED_LEN];
26057 let mut buf = if avail_len < Self::ENCODED_LEN {
26058 payload_buf[0..avail_len].copy_from_slice(__input);
26059 Bytes::new(&payload_buf)
26060 } else {
26061 Bytes::new(__input)
26062 };
26063 let mut __struct = Self::default();
26064 __struct.first_sequence = buf.get_u16_le();
26065 __struct.last_sequence = buf.get_u16_le();
26066 __struct.target_system = buf.get_u8();
26067 __struct.target_component = buf.get_u8();
26068 Ok(__struct)
26069 }
26070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26071 let mut __tmp = BytesMut::new(bytes);
26072 #[allow(clippy::absurd_extreme_comparisons)]
26073 #[allow(unused_comparisons)]
26074 if __tmp.remaining() < Self::ENCODED_LEN {
26075 panic!(
26076 "buffer is too small (need {} bytes, but got {})",
26077 Self::ENCODED_LEN,
26078 __tmp.remaining(),
26079 )
26080 }
26081 __tmp.put_u16_le(self.first_sequence);
26082 __tmp.put_u16_le(self.last_sequence);
26083 __tmp.put_u8(self.target_system);
26084 __tmp.put_u8(self.target_component);
26085 if matches!(version, MavlinkVersion::V2) {
26086 let len = __tmp.len();
26087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26088 } else {
26089 __tmp.len()
26090 }
26091 }
26092}
26093#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26094#[doc = ""]
26095#[doc = "ID: 142"]
26096#[derive(Debug, Clone, PartialEq)]
26097#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26099pub struct RESOURCE_REQUEST_DATA {
26100 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26101 pub request_id: u8,
26102 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26103 pub uri_type: u8,
26104 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26105 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26106 pub uri: [u8; 120],
26107 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26108 pub transfer_type: u8,
26109 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26110 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26111 pub storage: [u8; 120],
26112}
26113impl RESOURCE_REQUEST_DATA {
26114 pub const ENCODED_LEN: usize = 243usize;
26115 pub const DEFAULT: Self = Self {
26116 request_id: 0_u8,
26117 uri_type: 0_u8,
26118 uri: [0_u8; 120usize],
26119 transfer_type: 0_u8,
26120 storage: [0_u8; 120usize],
26121 };
26122 #[cfg(feature = "arbitrary")]
26123 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26124 use arbitrary::{Arbitrary, Unstructured};
26125 let mut buf = [0u8; 1024];
26126 rng.fill_bytes(&mut buf);
26127 let mut unstructured = Unstructured::new(&buf);
26128 Self::arbitrary(&mut unstructured).unwrap_or_default()
26129 }
26130}
26131impl Default for RESOURCE_REQUEST_DATA {
26132 fn default() -> Self {
26133 Self::DEFAULT.clone()
26134 }
26135}
26136impl MessageData for RESOURCE_REQUEST_DATA {
26137 type Message = MavMessage;
26138 const ID: u32 = 142u32;
26139 const NAME: &'static str = "RESOURCE_REQUEST";
26140 const EXTRA_CRC: u8 = 72u8;
26141 const ENCODED_LEN: usize = 243usize;
26142 fn deser(
26143 _version: MavlinkVersion,
26144 __input: &[u8],
26145 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26146 let avail_len = __input.len();
26147 let mut payload_buf = [0; Self::ENCODED_LEN];
26148 let mut buf = if avail_len < Self::ENCODED_LEN {
26149 payload_buf[0..avail_len].copy_from_slice(__input);
26150 Bytes::new(&payload_buf)
26151 } else {
26152 Bytes::new(__input)
26153 };
26154 let mut __struct = Self::default();
26155 __struct.request_id = buf.get_u8();
26156 __struct.uri_type = buf.get_u8();
26157 for v in &mut __struct.uri {
26158 let val = buf.get_u8();
26159 *v = val;
26160 }
26161 __struct.transfer_type = buf.get_u8();
26162 for v in &mut __struct.storage {
26163 let val = buf.get_u8();
26164 *v = val;
26165 }
26166 Ok(__struct)
26167 }
26168 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26169 let mut __tmp = BytesMut::new(bytes);
26170 #[allow(clippy::absurd_extreme_comparisons)]
26171 #[allow(unused_comparisons)]
26172 if __tmp.remaining() < Self::ENCODED_LEN {
26173 panic!(
26174 "buffer is too small (need {} bytes, but got {})",
26175 Self::ENCODED_LEN,
26176 __tmp.remaining(),
26177 )
26178 }
26179 __tmp.put_u8(self.request_id);
26180 __tmp.put_u8(self.uri_type);
26181 for val in &self.uri {
26182 __tmp.put_u8(*val);
26183 }
26184 __tmp.put_u8(self.transfer_type);
26185 for val in &self.storage {
26186 __tmp.put_u8(*val);
26187 }
26188 if matches!(version, MavlinkVersion::V2) {
26189 let len = __tmp.len();
26190 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26191 } else {
26192 __tmp.len()
26193 }
26194 }
26195}
26196#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26197#[doc = ""]
26198#[doc = "ID: 413"]
26199#[derive(Debug, Clone, PartialEq)]
26200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26202pub struct RESPONSE_EVENT_ERROR_DATA {
26203 #[doc = "Sequence number."]
26204 pub sequence: u16,
26205 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26206 pub sequence_oldest_available: u16,
26207 #[doc = "System ID"]
26208 pub target_system: u8,
26209 #[doc = "Component ID"]
26210 pub target_component: u8,
26211 #[doc = "Error reason."]
26212 pub reason: MavEventErrorReason,
26213}
26214impl RESPONSE_EVENT_ERROR_DATA {
26215 pub const ENCODED_LEN: usize = 7usize;
26216 pub const DEFAULT: Self = Self {
26217 sequence: 0_u16,
26218 sequence_oldest_available: 0_u16,
26219 target_system: 0_u8,
26220 target_component: 0_u8,
26221 reason: MavEventErrorReason::DEFAULT,
26222 };
26223 #[cfg(feature = "arbitrary")]
26224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26225 use arbitrary::{Arbitrary, Unstructured};
26226 let mut buf = [0u8; 1024];
26227 rng.fill_bytes(&mut buf);
26228 let mut unstructured = Unstructured::new(&buf);
26229 Self::arbitrary(&mut unstructured).unwrap_or_default()
26230 }
26231}
26232impl Default for RESPONSE_EVENT_ERROR_DATA {
26233 fn default() -> Self {
26234 Self::DEFAULT.clone()
26235 }
26236}
26237impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26238 type Message = MavMessage;
26239 const ID: u32 = 413u32;
26240 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26241 const EXTRA_CRC: u8 = 77u8;
26242 const ENCODED_LEN: usize = 7usize;
26243 fn deser(
26244 _version: MavlinkVersion,
26245 __input: &[u8],
26246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26247 let avail_len = __input.len();
26248 let mut payload_buf = [0; Self::ENCODED_LEN];
26249 let mut buf = if avail_len < Self::ENCODED_LEN {
26250 payload_buf[0..avail_len].copy_from_slice(__input);
26251 Bytes::new(&payload_buf)
26252 } else {
26253 Bytes::new(__input)
26254 };
26255 let mut __struct = Self::default();
26256 __struct.sequence = buf.get_u16_le();
26257 __struct.sequence_oldest_available = buf.get_u16_le();
26258 __struct.target_system = buf.get_u8();
26259 __struct.target_component = buf.get_u8();
26260 let tmp = buf.get_u8();
26261 __struct.reason =
26262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26263 enum_type: "MavEventErrorReason",
26264 value: tmp as u32,
26265 })?;
26266 Ok(__struct)
26267 }
26268 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26269 let mut __tmp = BytesMut::new(bytes);
26270 #[allow(clippy::absurd_extreme_comparisons)]
26271 #[allow(unused_comparisons)]
26272 if __tmp.remaining() < Self::ENCODED_LEN {
26273 panic!(
26274 "buffer is too small (need {} bytes, but got {})",
26275 Self::ENCODED_LEN,
26276 __tmp.remaining(),
26277 )
26278 }
26279 __tmp.put_u16_le(self.sequence);
26280 __tmp.put_u16_le(self.sequence_oldest_available);
26281 __tmp.put_u8(self.target_system);
26282 __tmp.put_u8(self.target_component);
26283 __tmp.put_u8(self.reason as u8);
26284 if matches!(version, MavlinkVersion::V2) {
26285 let len = __tmp.len();
26286 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26287 } else {
26288 __tmp.len()
26289 }
26290 }
26291}
26292#[doc = "Read out the safety zone the MAV currently assumes."]
26293#[doc = ""]
26294#[doc = "ID: 55"]
26295#[derive(Debug, Clone, PartialEq)]
26296#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26297#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26298pub struct SAFETY_ALLOWED_AREA_DATA {
26299 #[doc = "x position 1 / Latitude 1"]
26300 pub p1x: f32,
26301 #[doc = "y position 1 / Longitude 1"]
26302 pub p1y: f32,
26303 #[doc = "z position 1 / Altitude 1"]
26304 pub p1z: f32,
26305 #[doc = "x position 2 / Latitude 2"]
26306 pub p2x: f32,
26307 #[doc = "y position 2 / Longitude 2"]
26308 pub p2y: f32,
26309 #[doc = "z position 2 / Altitude 2"]
26310 pub p2z: f32,
26311 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26312 pub frame: MavFrame,
26313}
26314impl SAFETY_ALLOWED_AREA_DATA {
26315 pub const ENCODED_LEN: usize = 25usize;
26316 pub const DEFAULT: Self = Self {
26317 p1x: 0.0_f32,
26318 p1y: 0.0_f32,
26319 p1z: 0.0_f32,
26320 p2x: 0.0_f32,
26321 p2y: 0.0_f32,
26322 p2z: 0.0_f32,
26323 frame: MavFrame::DEFAULT,
26324 };
26325 #[cfg(feature = "arbitrary")]
26326 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26327 use arbitrary::{Arbitrary, Unstructured};
26328 let mut buf = [0u8; 1024];
26329 rng.fill_bytes(&mut buf);
26330 let mut unstructured = Unstructured::new(&buf);
26331 Self::arbitrary(&mut unstructured).unwrap_or_default()
26332 }
26333}
26334impl Default for SAFETY_ALLOWED_AREA_DATA {
26335 fn default() -> Self {
26336 Self::DEFAULT.clone()
26337 }
26338}
26339impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26340 type Message = MavMessage;
26341 const ID: u32 = 55u32;
26342 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26343 const EXTRA_CRC: u8 = 3u8;
26344 const ENCODED_LEN: usize = 25usize;
26345 fn deser(
26346 _version: MavlinkVersion,
26347 __input: &[u8],
26348 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26349 let avail_len = __input.len();
26350 let mut payload_buf = [0; Self::ENCODED_LEN];
26351 let mut buf = if avail_len < Self::ENCODED_LEN {
26352 payload_buf[0..avail_len].copy_from_slice(__input);
26353 Bytes::new(&payload_buf)
26354 } else {
26355 Bytes::new(__input)
26356 };
26357 let mut __struct = Self::default();
26358 __struct.p1x = buf.get_f32_le();
26359 __struct.p1y = buf.get_f32_le();
26360 __struct.p1z = buf.get_f32_le();
26361 __struct.p2x = buf.get_f32_le();
26362 __struct.p2y = buf.get_f32_le();
26363 __struct.p2z = buf.get_f32_le();
26364 let tmp = buf.get_u8();
26365 __struct.frame =
26366 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26367 enum_type: "MavFrame",
26368 value: tmp as u32,
26369 })?;
26370 Ok(__struct)
26371 }
26372 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26373 let mut __tmp = BytesMut::new(bytes);
26374 #[allow(clippy::absurd_extreme_comparisons)]
26375 #[allow(unused_comparisons)]
26376 if __tmp.remaining() < Self::ENCODED_LEN {
26377 panic!(
26378 "buffer is too small (need {} bytes, but got {})",
26379 Self::ENCODED_LEN,
26380 __tmp.remaining(),
26381 )
26382 }
26383 __tmp.put_f32_le(self.p1x);
26384 __tmp.put_f32_le(self.p1y);
26385 __tmp.put_f32_le(self.p1z);
26386 __tmp.put_f32_le(self.p2x);
26387 __tmp.put_f32_le(self.p2y);
26388 __tmp.put_f32_le(self.p2z);
26389 __tmp.put_u8(self.frame as u8);
26390 if matches!(version, MavlinkVersion::V2) {
26391 let len = __tmp.len();
26392 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26393 } else {
26394 __tmp.len()
26395 }
26396 }
26397}
26398#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26399#[doc = ""]
26400#[doc = "ID: 54"]
26401#[derive(Debug, Clone, PartialEq)]
26402#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26403#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26404pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26405 #[doc = "x position 1 / Latitude 1"]
26406 pub p1x: f32,
26407 #[doc = "y position 1 / Longitude 1"]
26408 pub p1y: f32,
26409 #[doc = "z position 1 / Altitude 1"]
26410 pub p1z: f32,
26411 #[doc = "x position 2 / Latitude 2"]
26412 pub p2x: f32,
26413 #[doc = "y position 2 / Longitude 2"]
26414 pub p2y: f32,
26415 #[doc = "z position 2 / Altitude 2"]
26416 pub p2z: f32,
26417 #[doc = "System ID"]
26418 pub target_system: u8,
26419 #[doc = "Component ID"]
26420 pub target_component: u8,
26421 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26422 pub frame: MavFrame,
26423}
26424impl SAFETY_SET_ALLOWED_AREA_DATA {
26425 pub const ENCODED_LEN: usize = 27usize;
26426 pub const DEFAULT: Self = Self {
26427 p1x: 0.0_f32,
26428 p1y: 0.0_f32,
26429 p1z: 0.0_f32,
26430 p2x: 0.0_f32,
26431 p2y: 0.0_f32,
26432 p2z: 0.0_f32,
26433 target_system: 0_u8,
26434 target_component: 0_u8,
26435 frame: MavFrame::DEFAULT,
26436 };
26437 #[cfg(feature = "arbitrary")]
26438 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26439 use arbitrary::{Arbitrary, Unstructured};
26440 let mut buf = [0u8; 1024];
26441 rng.fill_bytes(&mut buf);
26442 let mut unstructured = Unstructured::new(&buf);
26443 Self::arbitrary(&mut unstructured).unwrap_or_default()
26444 }
26445}
26446impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26447 fn default() -> Self {
26448 Self::DEFAULT.clone()
26449 }
26450}
26451impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26452 type Message = MavMessage;
26453 const ID: u32 = 54u32;
26454 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26455 const EXTRA_CRC: u8 = 15u8;
26456 const ENCODED_LEN: usize = 27usize;
26457 fn deser(
26458 _version: MavlinkVersion,
26459 __input: &[u8],
26460 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26461 let avail_len = __input.len();
26462 let mut payload_buf = [0; Self::ENCODED_LEN];
26463 let mut buf = if avail_len < Self::ENCODED_LEN {
26464 payload_buf[0..avail_len].copy_from_slice(__input);
26465 Bytes::new(&payload_buf)
26466 } else {
26467 Bytes::new(__input)
26468 };
26469 let mut __struct = Self::default();
26470 __struct.p1x = buf.get_f32_le();
26471 __struct.p1y = buf.get_f32_le();
26472 __struct.p1z = buf.get_f32_le();
26473 __struct.p2x = buf.get_f32_le();
26474 __struct.p2y = buf.get_f32_le();
26475 __struct.p2z = buf.get_f32_le();
26476 __struct.target_system = buf.get_u8();
26477 __struct.target_component = buf.get_u8();
26478 let tmp = buf.get_u8();
26479 __struct.frame =
26480 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26481 enum_type: "MavFrame",
26482 value: tmp as u32,
26483 })?;
26484 Ok(__struct)
26485 }
26486 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26487 let mut __tmp = BytesMut::new(bytes);
26488 #[allow(clippy::absurd_extreme_comparisons)]
26489 #[allow(unused_comparisons)]
26490 if __tmp.remaining() < Self::ENCODED_LEN {
26491 panic!(
26492 "buffer is too small (need {} bytes, but got {})",
26493 Self::ENCODED_LEN,
26494 __tmp.remaining(),
26495 )
26496 }
26497 __tmp.put_f32_le(self.p1x);
26498 __tmp.put_f32_le(self.p1y);
26499 __tmp.put_f32_le(self.p1z);
26500 __tmp.put_f32_le(self.p2x);
26501 __tmp.put_f32_le(self.p2y);
26502 __tmp.put_f32_le(self.p2z);
26503 __tmp.put_u8(self.target_system);
26504 __tmp.put_u8(self.target_component);
26505 __tmp.put_u8(self.frame as u8);
26506 if matches!(version, MavlinkVersion::V2) {
26507 let len = __tmp.len();
26508 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26509 } else {
26510 __tmp.len()
26511 }
26512 }
26513}
26514#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26515#[doc = ""]
26516#[doc = "ID: 26"]
26517#[derive(Debug, Clone, PartialEq)]
26518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26519#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26520pub struct SCALED_IMU_DATA {
26521 #[doc = "Timestamp (time since system boot)."]
26522 pub time_boot_ms: u32,
26523 #[doc = "X acceleration"]
26524 pub xacc: i16,
26525 #[doc = "Y acceleration"]
26526 pub yacc: i16,
26527 #[doc = "Z acceleration"]
26528 pub zacc: i16,
26529 #[doc = "Angular speed around X axis"]
26530 pub xgyro: i16,
26531 #[doc = "Angular speed around Y axis"]
26532 pub ygyro: i16,
26533 #[doc = "Angular speed around Z axis"]
26534 pub zgyro: i16,
26535 #[doc = "X Magnetic field"]
26536 pub xmag: i16,
26537 #[doc = "Y Magnetic field"]
26538 pub ymag: i16,
26539 #[doc = "Z Magnetic field"]
26540 pub zmag: i16,
26541 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26542 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26543 pub temperature: i16,
26544}
26545impl SCALED_IMU_DATA {
26546 pub const ENCODED_LEN: usize = 24usize;
26547 pub const DEFAULT: Self = Self {
26548 time_boot_ms: 0_u32,
26549 xacc: 0_i16,
26550 yacc: 0_i16,
26551 zacc: 0_i16,
26552 xgyro: 0_i16,
26553 ygyro: 0_i16,
26554 zgyro: 0_i16,
26555 xmag: 0_i16,
26556 ymag: 0_i16,
26557 zmag: 0_i16,
26558 temperature: 0_i16,
26559 };
26560 #[cfg(feature = "arbitrary")]
26561 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26562 use arbitrary::{Arbitrary, Unstructured};
26563 let mut buf = [0u8; 1024];
26564 rng.fill_bytes(&mut buf);
26565 let mut unstructured = Unstructured::new(&buf);
26566 Self::arbitrary(&mut unstructured).unwrap_or_default()
26567 }
26568}
26569impl Default for SCALED_IMU_DATA {
26570 fn default() -> Self {
26571 Self::DEFAULT.clone()
26572 }
26573}
26574impl MessageData for SCALED_IMU_DATA {
26575 type Message = MavMessage;
26576 const ID: u32 = 26u32;
26577 const NAME: &'static str = "SCALED_IMU";
26578 const EXTRA_CRC: u8 = 170u8;
26579 const ENCODED_LEN: usize = 24usize;
26580 fn deser(
26581 _version: MavlinkVersion,
26582 __input: &[u8],
26583 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26584 let avail_len = __input.len();
26585 let mut payload_buf = [0; Self::ENCODED_LEN];
26586 let mut buf = if avail_len < Self::ENCODED_LEN {
26587 payload_buf[0..avail_len].copy_from_slice(__input);
26588 Bytes::new(&payload_buf)
26589 } else {
26590 Bytes::new(__input)
26591 };
26592 let mut __struct = Self::default();
26593 __struct.time_boot_ms = buf.get_u32_le();
26594 __struct.xacc = buf.get_i16_le();
26595 __struct.yacc = buf.get_i16_le();
26596 __struct.zacc = buf.get_i16_le();
26597 __struct.xgyro = buf.get_i16_le();
26598 __struct.ygyro = buf.get_i16_le();
26599 __struct.zgyro = buf.get_i16_le();
26600 __struct.xmag = buf.get_i16_le();
26601 __struct.ymag = buf.get_i16_le();
26602 __struct.zmag = buf.get_i16_le();
26603 __struct.temperature = buf.get_i16_le();
26604 Ok(__struct)
26605 }
26606 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26607 let mut __tmp = BytesMut::new(bytes);
26608 #[allow(clippy::absurd_extreme_comparisons)]
26609 #[allow(unused_comparisons)]
26610 if __tmp.remaining() < Self::ENCODED_LEN {
26611 panic!(
26612 "buffer is too small (need {} bytes, but got {})",
26613 Self::ENCODED_LEN,
26614 __tmp.remaining(),
26615 )
26616 }
26617 __tmp.put_u32_le(self.time_boot_ms);
26618 __tmp.put_i16_le(self.xacc);
26619 __tmp.put_i16_le(self.yacc);
26620 __tmp.put_i16_le(self.zacc);
26621 __tmp.put_i16_le(self.xgyro);
26622 __tmp.put_i16_le(self.ygyro);
26623 __tmp.put_i16_le(self.zgyro);
26624 __tmp.put_i16_le(self.xmag);
26625 __tmp.put_i16_le(self.ymag);
26626 __tmp.put_i16_le(self.zmag);
26627 if matches!(version, MavlinkVersion::V2) {
26628 __tmp.put_i16_le(self.temperature);
26629 let len = __tmp.len();
26630 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26631 } else {
26632 __tmp.len()
26633 }
26634 }
26635}
26636#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26637#[doc = ""]
26638#[doc = "ID: 116"]
26639#[derive(Debug, Clone, PartialEq)]
26640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26641#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26642pub struct SCALED_IMU2_DATA {
26643 #[doc = "Timestamp (time since system boot)."]
26644 pub time_boot_ms: u32,
26645 #[doc = "X acceleration"]
26646 pub xacc: i16,
26647 #[doc = "Y acceleration"]
26648 pub yacc: i16,
26649 #[doc = "Z acceleration"]
26650 pub zacc: i16,
26651 #[doc = "Angular speed around X axis"]
26652 pub xgyro: i16,
26653 #[doc = "Angular speed around Y axis"]
26654 pub ygyro: i16,
26655 #[doc = "Angular speed around Z axis"]
26656 pub zgyro: i16,
26657 #[doc = "X Magnetic field"]
26658 pub xmag: i16,
26659 #[doc = "Y Magnetic field"]
26660 pub ymag: i16,
26661 #[doc = "Z Magnetic field"]
26662 pub zmag: i16,
26663 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26664 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26665 pub temperature: i16,
26666}
26667impl SCALED_IMU2_DATA {
26668 pub const ENCODED_LEN: usize = 24usize;
26669 pub const DEFAULT: Self = Self {
26670 time_boot_ms: 0_u32,
26671 xacc: 0_i16,
26672 yacc: 0_i16,
26673 zacc: 0_i16,
26674 xgyro: 0_i16,
26675 ygyro: 0_i16,
26676 zgyro: 0_i16,
26677 xmag: 0_i16,
26678 ymag: 0_i16,
26679 zmag: 0_i16,
26680 temperature: 0_i16,
26681 };
26682 #[cfg(feature = "arbitrary")]
26683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26684 use arbitrary::{Arbitrary, Unstructured};
26685 let mut buf = [0u8; 1024];
26686 rng.fill_bytes(&mut buf);
26687 let mut unstructured = Unstructured::new(&buf);
26688 Self::arbitrary(&mut unstructured).unwrap_or_default()
26689 }
26690}
26691impl Default for SCALED_IMU2_DATA {
26692 fn default() -> Self {
26693 Self::DEFAULT.clone()
26694 }
26695}
26696impl MessageData for SCALED_IMU2_DATA {
26697 type Message = MavMessage;
26698 const ID: u32 = 116u32;
26699 const NAME: &'static str = "SCALED_IMU2";
26700 const EXTRA_CRC: u8 = 76u8;
26701 const ENCODED_LEN: usize = 24usize;
26702 fn deser(
26703 _version: MavlinkVersion,
26704 __input: &[u8],
26705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26706 let avail_len = __input.len();
26707 let mut payload_buf = [0; Self::ENCODED_LEN];
26708 let mut buf = if avail_len < Self::ENCODED_LEN {
26709 payload_buf[0..avail_len].copy_from_slice(__input);
26710 Bytes::new(&payload_buf)
26711 } else {
26712 Bytes::new(__input)
26713 };
26714 let mut __struct = Self::default();
26715 __struct.time_boot_ms = buf.get_u32_le();
26716 __struct.xacc = buf.get_i16_le();
26717 __struct.yacc = buf.get_i16_le();
26718 __struct.zacc = buf.get_i16_le();
26719 __struct.xgyro = buf.get_i16_le();
26720 __struct.ygyro = buf.get_i16_le();
26721 __struct.zgyro = buf.get_i16_le();
26722 __struct.xmag = buf.get_i16_le();
26723 __struct.ymag = buf.get_i16_le();
26724 __struct.zmag = buf.get_i16_le();
26725 __struct.temperature = buf.get_i16_le();
26726 Ok(__struct)
26727 }
26728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26729 let mut __tmp = BytesMut::new(bytes);
26730 #[allow(clippy::absurd_extreme_comparisons)]
26731 #[allow(unused_comparisons)]
26732 if __tmp.remaining() < Self::ENCODED_LEN {
26733 panic!(
26734 "buffer is too small (need {} bytes, but got {})",
26735 Self::ENCODED_LEN,
26736 __tmp.remaining(),
26737 )
26738 }
26739 __tmp.put_u32_le(self.time_boot_ms);
26740 __tmp.put_i16_le(self.xacc);
26741 __tmp.put_i16_le(self.yacc);
26742 __tmp.put_i16_le(self.zacc);
26743 __tmp.put_i16_le(self.xgyro);
26744 __tmp.put_i16_le(self.ygyro);
26745 __tmp.put_i16_le(self.zgyro);
26746 __tmp.put_i16_le(self.xmag);
26747 __tmp.put_i16_le(self.ymag);
26748 __tmp.put_i16_le(self.zmag);
26749 if matches!(version, MavlinkVersion::V2) {
26750 __tmp.put_i16_le(self.temperature);
26751 let len = __tmp.len();
26752 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26753 } else {
26754 __tmp.len()
26755 }
26756 }
26757}
26758#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26759#[doc = ""]
26760#[doc = "ID: 129"]
26761#[derive(Debug, Clone, PartialEq)]
26762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26764pub struct SCALED_IMU3_DATA {
26765 #[doc = "Timestamp (time since system boot)."]
26766 pub time_boot_ms: u32,
26767 #[doc = "X acceleration"]
26768 pub xacc: i16,
26769 #[doc = "Y acceleration"]
26770 pub yacc: i16,
26771 #[doc = "Z acceleration"]
26772 pub zacc: i16,
26773 #[doc = "Angular speed around X axis"]
26774 pub xgyro: i16,
26775 #[doc = "Angular speed around Y axis"]
26776 pub ygyro: i16,
26777 #[doc = "Angular speed around Z axis"]
26778 pub zgyro: i16,
26779 #[doc = "X Magnetic field"]
26780 pub xmag: i16,
26781 #[doc = "Y Magnetic field"]
26782 pub ymag: i16,
26783 #[doc = "Z Magnetic field"]
26784 pub zmag: i16,
26785 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26786 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26787 pub temperature: i16,
26788}
26789impl SCALED_IMU3_DATA {
26790 pub const ENCODED_LEN: usize = 24usize;
26791 pub const DEFAULT: Self = Self {
26792 time_boot_ms: 0_u32,
26793 xacc: 0_i16,
26794 yacc: 0_i16,
26795 zacc: 0_i16,
26796 xgyro: 0_i16,
26797 ygyro: 0_i16,
26798 zgyro: 0_i16,
26799 xmag: 0_i16,
26800 ymag: 0_i16,
26801 zmag: 0_i16,
26802 temperature: 0_i16,
26803 };
26804 #[cfg(feature = "arbitrary")]
26805 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26806 use arbitrary::{Arbitrary, Unstructured};
26807 let mut buf = [0u8; 1024];
26808 rng.fill_bytes(&mut buf);
26809 let mut unstructured = Unstructured::new(&buf);
26810 Self::arbitrary(&mut unstructured).unwrap_or_default()
26811 }
26812}
26813impl Default for SCALED_IMU3_DATA {
26814 fn default() -> Self {
26815 Self::DEFAULT.clone()
26816 }
26817}
26818impl MessageData for SCALED_IMU3_DATA {
26819 type Message = MavMessage;
26820 const ID: u32 = 129u32;
26821 const NAME: &'static str = "SCALED_IMU3";
26822 const EXTRA_CRC: u8 = 46u8;
26823 const ENCODED_LEN: usize = 24usize;
26824 fn deser(
26825 _version: MavlinkVersion,
26826 __input: &[u8],
26827 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26828 let avail_len = __input.len();
26829 let mut payload_buf = [0; Self::ENCODED_LEN];
26830 let mut buf = if avail_len < Self::ENCODED_LEN {
26831 payload_buf[0..avail_len].copy_from_slice(__input);
26832 Bytes::new(&payload_buf)
26833 } else {
26834 Bytes::new(__input)
26835 };
26836 let mut __struct = Self::default();
26837 __struct.time_boot_ms = buf.get_u32_le();
26838 __struct.xacc = buf.get_i16_le();
26839 __struct.yacc = buf.get_i16_le();
26840 __struct.zacc = buf.get_i16_le();
26841 __struct.xgyro = buf.get_i16_le();
26842 __struct.ygyro = buf.get_i16_le();
26843 __struct.zgyro = buf.get_i16_le();
26844 __struct.xmag = buf.get_i16_le();
26845 __struct.ymag = buf.get_i16_le();
26846 __struct.zmag = buf.get_i16_le();
26847 __struct.temperature = buf.get_i16_le();
26848 Ok(__struct)
26849 }
26850 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26851 let mut __tmp = BytesMut::new(bytes);
26852 #[allow(clippy::absurd_extreme_comparisons)]
26853 #[allow(unused_comparisons)]
26854 if __tmp.remaining() < Self::ENCODED_LEN {
26855 panic!(
26856 "buffer is too small (need {} bytes, but got {})",
26857 Self::ENCODED_LEN,
26858 __tmp.remaining(),
26859 )
26860 }
26861 __tmp.put_u32_le(self.time_boot_ms);
26862 __tmp.put_i16_le(self.xacc);
26863 __tmp.put_i16_le(self.yacc);
26864 __tmp.put_i16_le(self.zacc);
26865 __tmp.put_i16_le(self.xgyro);
26866 __tmp.put_i16_le(self.ygyro);
26867 __tmp.put_i16_le(self.zgyro);
26868 __tmp.put_i16_le(self.xmag);
26869 __tmp.put_i16_le(self.ymag);
26870 __tmp.put_i16_le(self.zmag);
26871 if matches!(version, MavlinkVersion::V2) {
26872 __tmp.put_i16_le(self.temperature);
26873 let len = __tmp.len();
26874 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26875 } else {
26876 __tmp.len()
26877 }
26878 }
26879}
26880#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
26881#[doc = ""]
26882#[doc = "ID: 29"]
26883#[derive(Debug, Clone, PartialEq)]
26884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26885#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26886pub struct SCALED_PRESSURE_DATA {
26887 #[doc = "Timestamp (time since system boot)."]
26888 pub time_boot_ms: u32,
26889 #[doc = "Absolute pressure"]
26890 pub press_abs: f32,
26891 #[doc = "Differential pressure 1"]
26892 pub press_diff: f32,
26893 #[doc = "Absolute pressure temperature"]
26894 pub temperature: i16,
26895 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26896 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26897 pub temperature_press_diff: i16,
26898}
26899impl SCALED_PRESSURE_DATA {
26900 pub const ENCODED_LEN: usize = 16usize;
26901 pub const DEFAULT: Self = Self {
26902 time_boot_ms: 0_u32,
26903 press_abs: 0.0_f32,
26904 press_diff: 0.0_f32,
26905 temperature: 0_i16,
26906 temperature_press_diff: 0_i16,
26907 };
26908 #[cfg(feature = "arbitrary")]
26909 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26910 use arbitrary::{Arbitrary, Unstructured};
26911 let mut buf = [0u8; 1024];
26912 rng.fill_bytes(&mut buf);
26913 let mut unstructured = Unstructured::new(&buf);
26914 Self::arbitrary(&mut unstructured).unwrap_or_default()
26915 }
26916}
26917impl Default for SCALED_PRESSURE_DATA {
26918 fn default() -> Self {
26919 Self::DEFAULT.clone()
26920 }
26921}
26922impl MessageData for SCALED_PRESSURE_DATA {
26923 type Message = MavMessage;
26924 const ID: u32 = 29u32;
26925 const NAME: &'static str = "SCALED_PRESSURE";
26926 const EXTRA_CRC: u8 = 115u8;
26927 const ENCODED_LEN: usize = 16usize;
26928 fn deser(
26929 _version: MavlinkVersion,
26930 __input: &[u8],
26931 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26932 let avail_len = __input.len();
26933 let mut payload_buf = [0; Self::ENCODED_LEN];
26934 let mut buf = if avail_len < Self::ENCODED_LEN {
26935 payload_buf[0..avail_len].copy_from_slice(__input);
26936 Bytes::new(&payload_buf)
26937 } else {
26938 Bytes::new(__input)
26939 };
26940 let mut __struct = Self::default();
26941 __struct.time_boot_ms = buf.get_u32_le();
26942 __struct.press_abs = buf.get_f32_le();
26943 __struct.press_diff = buf.get_f32_le();
26944 __struct.temperature = buf.get_i16_le();
26945 __struct.temperature_press_diff = buf.get_i16_le();
26946 Ok(__struct)
26947 }
26948 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26949 let mut __tmp = BytesMut::new(bytes);
26950 #[allow(clippy::absurd_extreme_comparisons)]
26951 #[allow(unused_comparisons)]
26952 if __tmp.remaining() < Self::ENCODED_LEN {
26953 panic!(
26954 "buffer is too small (need {} bytes, but got {})",
26955 Self::ENCODED_LEN,
26956 __tmp.remaining(),
26957 )
26958 }
26959 __tmp.put_u32_le(self.time_boot_ms);
26960 __tmp.put_f32_le(self.press_abs);
26961 __tmp.put_f32_le(self.press_diff);
26962 __tmp.put_i16_le(self.temperature);
26963 if matches!(version, MavlinkVersion::V2) {
26964 __tmp.put_i16_le(self.temperature_press_diff);
26965 let len = __tmp.len();
26966 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26967 } else {
26968 __tmp.len()
26969 }
26970 }
26971}
26972#[doc = "Barometer readings for 2nd barometer."]
26973#[doc = ""]
26974#[doc = "ID: 137"]
26975#[derive(Debug, Clone, PartialEq)]
26976#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26978pub struct SCALED_PRESSURE2_DATA {
26979 #[doc = "Timestamp (time since system boot)."]
26980 pub time_boot_ms: u32,
26981 #[doc = "Absolute pressure"]
26982 pub press_abs: f32,
26983 #[doc = "Differential pressure"]
26984 pub press_diff: f32,
26985 #[doc = "Absolute pressure temperature"]
26986 pub temperature: i16,
26987 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26988 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26989 pub temperature_press_diff: i16,
26990}
26991impl SCALED_PRESSURE2_DATA {
26992 pub const ENCODED_LEN: usize = 16usize;
26993 pub const DEFAULT: Self = Self {
26994 time_boot_ms: 0_u32,
26995 press_abs: 0.0_f32,
26996 press_diff: 0.0_f32,
26997 temperature: 0_i16,
26998 temperature_press_diff: 0_i16,
26999 };
27000 #[cfg(feature = "arbitrary")]
27001 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27002 use arbitrary::{Arbitrary, Unstructured};
27003 let mut buf = [0u8; 1024];
27004 rng.fill_bytes(&mut buf);
27005 let mut unstructured = Unstructured::new(&buf);
27006 Self::arbitrary(&mut unstructured).unwrap_or_default()
27007 }
27008}
27009impl Default for SCALED_PRESSURE2_DATA {
27010 fn default() -> Self {
27011 Self::DEFAULT.clone()
27012 }
27013}
27014impl MessageData for SCALED_PRESSURE2_DATA {
27015 type Message = MavMessage;
27016 const ID: u32 = 137u32;
27017 const NAME: &'static str = "SCALED_PRESSURE2";
27018 const EXTRA_CRC: u8 = 195u8;
27019 const ENCODED_LEN: usize = 16usize;
27020 fn deser(
27021 _version: MavlinkVersion,
27022 __input: &[u8],
27023 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27024 let avail_len = __input.len();
27025 let mut payload_buf = [0; Self::ENCODED_LEN];
27026 let mut buf = if avail_len < Self::ENCODED_LEN {
27027 payload_buf[0..avail_len].copy_from_slice(__input);
27028 Bytes::new(&payload_buf)
27029 } else {
27030 Bytes::new(__input)
27031 };
27032 let mut __struct = Self::default();
27033 __struct.time_boot_ms = buf.get_u32_le();
27034 __struct.press_abs = buf.get_f32_le();
27035 __struct.press_diff = buf.get_f32_le();
27036 __struct.temperature = buf.get_i16_le();
27037 __struct.temperature_press_diff = buf.get_i16_le();
27038 Ok(__struct)
27039 }
27040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27041 let mut __tmp = BytesMut::new(bytes);
27042 #[allow(clippy::absurd_extreme_comparisons)]
27043 #[allow(unused_comparisons)]
27044 if __tmp.remaining() < Self::ENCODED_LEN {
27045 panic!(
27046 "buffer is too small (need {} bytes, but got {})",
27047 Self::ENCODED_LEN,
27048 __tmp.remaining(),
27049 )
27050 }
27051 __tmp.put_u32_le(self.time_boot_ms);
27052 __tmp.put_f32_le(self.press_abs);
27053 __tmp.put_f32_le(self.press_diff);
27054 __tmp.put_i16_le(self.temperature);
27055 if matches!(version, MavlinkVersion::V2) {
27056 __tmp.put_i16_le(self.temperature_press_diff);
27057 let len = __tmp.len();
27058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27059 } else {
27060 __tmp.len()
27061 }
27062 }
27063}
27064#[doc = "Barometer readings for 3rd barometer."]
27065#[doc = ""]
27066#[doc = "ID: 143"]
27067#[derive(Debug, Clone, PartialEq)]
27068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27070pub struct SCALED_PRESSURE3_DATA {
27071 #[doc = "Timestamp (time since system boot)."]
27072 pub time_boot_ms: u32,
27073 #[doc = "Absolute pressure"]
27074 pub press_abs: f32,
27075 #[doc = "Differential pressure"]
27076 pub press_diff: f32,
27077 #[doc = "Absolute pressure temperature"]
27078 pub temperature: i16,
27079 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27080 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27081 pub temperature_press_diff: i16,
27082}
27083impl SCALED_PRESSURE3_DATA {
27084 pub const ENCODED_LEN: usize = 16usize;
27085 pub const DEFAULT: Self = Self {
27086 time_boot_ms: 0_u32,
27087 press_abs: 0.0_f32,
27088 press_diff: 0.0_f32,
27089 temperature: 0_i16,
27090 temperature_press_diff: 0_i16,
27091 };
27092 #[cfg(feature = "arbitrary")]
27093 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27094 use arbitrary::{Arbitrary, Unstructured};
27095 let mut buf = [0u8; 1024];
27096 rng.fill_bytes(&mut buf);
27097 let mut unstructured = Unstructured::new(&buf);
27098 Self::arbitrary(&mut unstructured).unwrap_or_default()
27099 }
27100}
27101impl Default for SCALED_PRESSURE3_DATA {
27102 fn default() -> Self {
27103 Self::DEFAULT.clone()
27104 }
27105}
27106impl MessageData for SCALED_PRESSURE3_DATA {
27107 type Message = MavMessage;
27108 const ID: u32 = 143u32;
27109 const NAME: &'static str = "SCALED_PRESSURE3";
27110 const EXTRA_CRC: u8 = 131u8;
27111 const ENCODED_LEN: usize = 16usize;
27112 fn deser(
27113 _version: MavlinkVersion,
27114 __input: &[u8],
27115 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27116 let avail_len = __input.len();
27117 let mut payload_buf = [0; Self::ENCODED_LEN];
27118 let mut buf = if avail_len < Self::ENCODED_LEN {
27119 payload_buf[0..avail_len].copy_from_slice(__input);
27120 Bytes::new(&payload_buf)
27121 } else {
27122 Bytes::new(__input)
27123 };
27124 let mut __struct = Self::default();
27125 __struct.time_boot_ms = buf.get_u32_le();
27126 __struct.press_abs = buf.get_f32_le();
27127 __struct.press_diff = buf.get_f32_le();
27128 __struct.temperature = buf.get_i16_le();
27129 __struct.temperature_press_diff = buf.get_i16_le();
27130 Ok(__struct)
27131 }
27132 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27133 let mut __tmp = BytesMut::new(bytes);
27134 #[allow(clippy::absurd_extreme_comparisons)]
27135 #[allow(unused_comparisons)]
27136 if __tmp.remaining() < Self::ENCODED_LEN {
27137 panic!(
27138 "buffer is too small (need {} bytes, but got {})",
27139 Self::ENCODED_LEN,
27140 __tmp.remaining(),
27141 )
27142 }
27143 __tmp.put_u32_le(self.time_boot_ms);
27144 __tmp.put_f32_le(self.press_abs);
27145 __tmp.put_f32_le(self.press_diff);
27146 __tmp.put_i16_le(self.temperature);
27147 if matches!(version, MavlinkVersion::V2) {
27148 __tmp.put_i16_le(self.temperature_press_diff);
27149 let len = __tmp.len();
27150 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27151 } else {
27152 __tmp.len()
27153 }
27154 }
27155}
27156#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27157#[doc = ""]
27158#[doc = "ID: 126"]
27159#[derive(Debug, Clone, PartialEq)]
27160#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27161#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27162pub struct SERIAL_CONTROL_DATA {
27163 #[doc = "Baudrate of transfer. Zero means no change."]
27164 pub baudrate: u32,
27165 #[doc = "Timeout for reply data"]
27166 pub timeout: u16,
27167 #[doc = "Serial control device type."]
27168 pub device: SerialControlDev,
27169 #[doc = "Bitmap of serial control flags."]
27170 pub flags: SerialControlFlag,
27171 #[doc = "how many bytes in this transfer"]
27172 pub count: u8,
27173 #[doc = "serial data"]
27174 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27175 pub data: [u8; 70],
27176 #[doc = "System ID"]
27177 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27178 pub target_system: u8,
27179 #[doc = "Component ID"]
27180 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27181 pub target_component: u8,
27182}
27183impl SERIAL_CONTROL_DATA {
27184 pub const ENCODED_LEN: usize = 81usize;
27185 pub const DEFAULT: Self = Self {
27186 baudrate: 0_u32,
27187 timeout: 0_u16,
27188 device: SerialControlDev::DEFAULT,
27189 flags: SerialControlFlag::DEFAULT,
27190 count: 0_u8,
27191 data: [0_u8; 70usize],
27192 target_system: 0_u8,
27193 target_component: 0_u8,
27194 };
27195 #[cfg(feature = "arbitrary")]
27196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27197 use arbitrary::{Arbitrary, Unstructured};
27198 let mut buf = [0u8; 1024];
27199 rng.fill_bytes(&mut buf);
27200 let mut unstructured = Unstructured::new(&buf);
27201 Self::arbitrary(&mut unstructured).unwrap_or_default()
27202 }
27203}
27204impl Default for SERIAL_CONTROL_DATA {
27205 fn default() -> Self {
27206 Self::DEFAULT.clone()
27207 }
27208}
27209impl MessageData for SERIAL_CONTROL_DATA {
27210 type Message = MavMessage;
27211 const ID: u32 = 126u32;
27212 const NAME: &'static str = "SERIAL_CONTROL";
27213 const EXTRA_CRC: u8 = 220u8;
27214 const ENCODED_LEN: usize = 81usize;
27215 fn deser(
27216 _version: MavlinkVersion,
27217 __input: &[u8],
27218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27219 let avail_len = __input.len();
27220 let mut payload_buf = [0; Self::ENCODED_LEN];
27221 let mut buf = if avail_len < Self::ENCODED_LEN {
27222 payload_buf[0..avail_len].copy_from_slice(__input);
27223 Bytes::new(&payload_buf)
27224 } else {
27225 Bytes::new(__input)
27226 };
27227 let mut __struct = Self::default();
27228 __struct.baudrate = buf.get_u32_le();
27229 __struct.timeout = buf.get_u16_le();
27230 let tmp = buf.get_u8();
27231 __struct.device =
27232 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27233 enum_type: "SerialControlDev",
27234 value: tmp as u32,
27235 })?;
27236 let tmp = buf.get_u8();
27237 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
27238 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27239 flag_type: "SerialControlFlag",
27240 value: tmp as u32,
27241 })?;
27242 __struct.count = buf.get_u8();
27243 for v in &mut __struct.data {
27244 let val = buf.get_u8();
27245 *v = val;
27246 }
27247 __struct.target_system = buf.get_u8();
27248 __struct.target_component = buf.get_u8();
27249 Ok(__struct)
27250 }
27251 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27252 let mut __tmp = BytesMut::new(bytes);
27253 #[allow(clippy::absurd_extreme_comparisons)]
27254 #[allow(unused_comparisons)]
27255 if __tmp.remaining() < Self::ENCODED_LEN {
27256 panic!(
27257 "buffer is too small (need {} bytes, but got {})",
27258 Self::ENCODED_LEN,
27259 __tmp.remaining(),
27260 )
27261 }
27262 __tmp.put_u32_le(self.baudrate);
27263 __tmp.put_u16_le(self.timeout);
27264 __tmp.put_u8(self.device as u8);
27265 __tmp.put_u8(self.flags.bits());
27266 __tmp.put_u8(self.count);
27267 for val in &self.data {
27268 __tmp.put_u8(*val);
27269 }
27270 if matches!(version, MavlinkVersion::V2) {
27271 __tmp.put_u8(self.target_system);
27272 __tmp.put_u8(self.target_component);
27273 let len = __tmp.len();
27274 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27275 } else {
27276 __tmp.len()
27277 }
27278 }
27279}
27280#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27281#[doc = ""]
27282#[doc = "ID: 36"]
27283#[derive(Debug, Clone, PartialEq)]
27284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27286pub struct SERVO_OUTPUT_RAW_DATA {
27287 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27288 pub time_usec: u32,
27289 #[doc = "Servo output 1 value"]
27290 pub servo1_raw: u16,
27291 #[doc = "Servo output 2 value"]
27292 pub servo2_raw: u16,
27293 #[doc = "Servo output 3 value"]
27294 pub servo3_raw: u16,
27295 #[doc = "Servo output 4 value"]
27296 pub servo4_raw: u16,
27297 #[doc = "Servo output 5 value"]
27298 pub servo5_raw: u16,
27299 #[doc = "Servo output 6 value"]
27300 pub servo6_raw: u16,
27301 #[doc = "Servo output 7 value"]
27302 pub servo7_raw: u16,
27303 #[doc = "Servo output 8 value"]
27304 pub servo8_raw: u16,
27305 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27306 pub port: u8,
27307 #[doc = "Servo output 9 value"]
27308 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27309 pub servo9_raw: u16,
27310 #[doc = "Servo output 10 value"]
27311 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27312 pub servo10_raw: u16,
27313 #[doc = "Servo output 11 value"]
27314 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27315 pub servo11_raw: u16,
27316 #[doc = "Servo output 12 value"]
27317 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27318 pub servo12_raw: u16,
27319 #[doc = "Servo output 13 value"]
27320 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27321 pub servo13_raw: u16,
27322 #[doc = "Servo output 14 value"]
27323 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27324 pub servo14_raw: u16,
27325 #[doc = "Servo output 15 value"]
27326 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27327 pub servo15_raw: u16,
27328 #[doc = "Servo output 16 value"]
27329 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27330 pub servo16_raw: u16,
27331}
27332impl SERVO_OUTPUT_RAW_DATA {
27333 pub const ENCODED_LEN: usize = 37usize;
27334 pub const DEFAULT: Self = Self {
27335 time_usec: 0_u32,
27336 servo1_raw: 0_u16,
27337 servo2_raw: 0_u16,
27338 servo3_raw: 0_u16,
27339 servo4_raw: 0_u16,
27340 servo5_raw: 0_u16,
27341 servo6_raw: 0_u16,
27342 servo7_raw: 0_u16,
27343 servo8_raw: 0_u16,
27344 port: 0_u8,
27345 servo9_raw: 0_u16,
27346 servo10_raw: 0_u16,
27347 servo11_raw: 0_u16,
27348 servo12_raw: 0_u16,
27349 servo13_raw: 0_u16,
27350 servo14_raw: 0_u16,
27351 servo15_raw: 0_u16,
27352 servo16_raw: 0_u16,
27353 };
27354 #[cfg(feature = "arbitrary")]
27355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27356 use arbitrary::{Arbitrary, Unstructured};
27357 let mut buf = [0u8; 1024];
27358 rng.fill_bytes(&mut buf);
27359 let mut unstructured = Unstructured::new(&buf);
27360 Self::arbitrary(&mut unstructured).unwrap_or_default()
27361 }
27362}
27363impl Default for SERVO_OUTPUT_RAW_DATA {
27364 fn default() -> Self {
27365 Self::DEFAULT.clone()
27366 }
27367}
27368impl MessageData for SERVO_OUTPUT_RAW_DATA {
27369 type Message = MavMessage;
27370 const ID: u32 = 36u32;
27371 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27372 const EXTRA_CRC: u8 = 222u8;
27373 const ENCODED_LEN: usize = 37usize;
27374 fn deser(
27375 _version: MavlinkVersion,
27376 __input: &[u8],
27377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27378 let avail_len = __input.len();
27379 let mut payload_buf = [0; Self::ENCODED_LEN];
27380 let mut buf = if avail_len < Self::ENCODED_LEN {
27381 payload_buf[0..avail_len].copy_from_slice(__input);
27382 Bytes::new(&payload_buf)
27383 } else {
27384 Bytes::new(__input)
27385 };
27386 let mut __struct = Self::default();
27387 __struct.time_usec = buf.get_u32_le();
27388 __struct.servo1_raw = buf.get_u16_le();
27389 __struct.servo2_raw = buf.get_u16_le();
27390 __struct.servo3_raw = buf.get_u16_le();
27391 __struct.servo4_raw = buf.get_u16_le();
27392 __struct.servo5_raw = buf.get_u16_le();
27393 __struct.servo6_raw = buf.get_u16_le();
27394 __struct.servo7_raw = buf.get_u16_le();
27395 __struct.servo8_raw = buf.get_u16_le();
27396 __struct.port = buf.get_u8();
27397 __struct.servo9_raw = buf.get_u16_le();
27398 __struct.servo10_raw = buf.get_u16_le();
27399 __struct.servo11_raw = buf.get_u16_le();
27400 __struct.servo12_raw = buf.get_u16_le();
27401 __struct.servo13_raw = buf.get_u16_le();
27402 __struct.servo14_raw = buf.get_u16_le();
27403 __struct.servo15_raw = buf.get_u16_le();
27404 __struct.servo16_raw = buf.get_u16_le();
27405 Ok(__struct)
27406 }
27407 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27408 let mut __tmp = BytesMut::new(bytes);
27409 #[allow(clippy::absurd_extreme_comparisons)]
27410 #[allow(unused_comparisons)]
27411 if __tmp.remaining() < Self::ENCODED_LEN {
27412 panic!(
27413 "buffer is too small (need {} bytes, but got {})",
27414 Self::ENCODED_LEN,
27415 __tmp.remaining(),
27416 )
27417 }
27418 __tmp.put_u32_le(self.time_usec);
27419 __tmp.put_u16_le(self.servo1_raw);
27420 __tmp.put_u16_le(self.servo2_raw);
27421 __tmp.put_u16_le(self.servo3_raw);
27422 __tmp.put_u16_le(self.servo4_raw);
27423 __tmp.put_u16_le(self.servo5_raw);
27424 __tmp.put_u16_le(self.servo6_raw);
27425 __tmp.put_u16_le(self.servo7_raw);
27426 __tmp.put_u16_le(self.servo8_raw);
27427 __tmp.put_u8(self.port);
27428 if matches!(version, MavlinkVersion::V2) {
27429 __tmp.put_u16_le(self.servo9_raw);
27430 __tmp.put_u16_le(self.servo10_raw);
27431 __tmp.put_u16_le(self.servo11_raw);
27432 __tmp.put_u16_le(self.servo12_raw);
27433 __tmp.put_u16_le(self.servo13_raw);
27434 __tmp.put_u16_le(self.servo14_raw);
27435 __tmp.put_u16_le(self.servo15_raw);
27436 __tmp.put_u16_le(self.servo16_raw);
27437 let len = __tmp.len();
27438 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27439 } else {
27440 __tmp.len()
27441 }
27442 }
27443}
27444#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27445#[doc = ""]
27446#[doc = "ID: 256"]
27447#[derive(Debug, Clone, PartialEq)]
27448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27450pub struct SETUP_SIGNING_DATA {
27451 #[doc = "initial timestamp"]
27452 pub initial_timestamp: u64,
27453 #[doc = "system id of the target"]
27454 pub target_system: u8,
27455 #[doc = "component ID of the target"]
27456 pub target_component: u8,
27457 #[doc = "signing key"]
27458 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27459 pub secret_key: [u8; 32],
27460}
27461impl SETUP_SIGNING_DATA {
27462 pub const ENCODED_LEN: usize = 42usize;
27463 pub const DEFAULT: Self = Self {
27464 initial_timestamp: 0_u64,
27465 target_system: 0_u8,
27466 target_component: 0_u8,
27467 secret_key: [0_u8; 32usize],
27468 };
27469 #[cfg(feature = "arbitrary")]
27470 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27471 use arbitrary::{Arbitrary, Unstructured};
27472 let mut buf = [0u8; 1024];
27473 rng.fill_bytes(&mut buf);
27474 let mut unstructured = Unstructured::new(&buf);
27475 Self::arbitrary(&mut unstructured).unwrap_or_default()
27476 }
27477}
27478impl Default for SETUP_SIGNING_DATA {
27479 fn default() -> Self {
27480 Self::DEFAULT.clone()
27481 }
27482}
27483impl MessageData for SETUP_SIGNING_DATA {
27484 type Message = MavMessage;
27485 const ID: u32 = 256u32;
27486 const NAME: &'static str = "SETUP_SIGNING";
27487 const EXTRA_CRC: u8 = 71u8;
27488 const ENCODED_LEN: usize = 42usize;
27489 fn deser(
27490 _version: MavlinkVersion,
27491 __input: &[u8],
27492 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27493 let avail_len = __input.len();
27494 let mut payload_buf = [0; Self::ENCODED_LEN];
27495 let mut buf = if avail_len < Self::ENCODED_LEN {
27496 payload_buf[0..avail_len].copy_from_slice(__input);
27497 Bytes::new(&payload_buf)
27498 } else {
27499 Bytes::new(__input)
27500 };
27501 let mut __struct = Self::default();
27502 __struct.initial_timestamp = buf.get_u64_le();
27503 __struct.target_system = buf.get_u8();
27504 __struct.target_component = buf.get_u8();
27505 for v in &mut __struct.secret_key {
27506 let val = buf.get_u8();
27507 *v = val;
27508 }
27509 Ok(__struct)
27510 }
27511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27512 let mut __tmp = BytesMut::new(bytes);
27513 #[allow(clippy::absurd_extreme_comparisons)]
27514 #[allow(unused_comparisons)]
27515 if __tmp.remaining() < Self::ENCODED_LEN {
27516 panic!(
27517 "buffer is too small (need {} bytes, but got {})",
27518 Self::ENCODED_LEN,
27519 __tmp.remaining(),
27520 )
27521 }
27522 __tmp.put_u64_le(self.initial_timestamp);
27523 __tmp.put_u8(self.target_system);
27524 __tmp.put_u8(self.target_component);
27525 for val in &self.secret_key {
27526 __tmp.put_u8(*val);
27527 }
27528 if matches!(version, MavlinkVersion::V2) {
27529 let len = __tmp.len();
27530 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27531 } else {
27532 __tmp.len()
27533 }
27534 }
27535}
27536#[doc = "Set the vehicle attitude and body angular rates."]
27537#[doc = ""]
27538#[doc = "ID: 139"]
27539#[derive(Debug, Clone, PartialEq)]
27540#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27542pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27543 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27544 pub time_usec: u64,
27545 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27546 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27547 pub controls: [f32; 8],
27548 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27549 pub group_mlx: u8,
27550 #[doc = "System ID"]
27551 pub target_system: u8,
27552 #[doc = "Component ID"]
27553 pub target_component: u8,
27554}
27555impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27556 pub const ENCODED_LEN: usize = 43usize;
27557 pub const DEFAULT: Self = Self {
27558 time_usec: 0_u64,
27559 controls: [0.0_f32; 8usize],
27560 group_mlx: 0_u8,
27561 target_system: 0_u8,
27562 target_component: 0_u8,
27563 };
27564 #[cfg(feature = "arbitrary")]
27565 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27566 use arbitrary::{Arbitrary, Unstructured};
27567 let mut buf = [0u8; 1024];
27568 rng.fill_bytes(&mut buf);
27569 let mut unstructured = Unstructured::new(&buf);
27570 Self::arbitrary(&mut unstructured).unwrap_or_default()
27571 }
27572}
27573impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27574 fn default() -> Self {
27575 Self::DEFAULT.clone()
27576 }
27577}
27578impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27579 type Message = MavMessage;
27580 const ID: u32 = 139u32;
27581 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27582 const EXTRA_CRC: u8 = 168u8;
27583 const ENCODED_LEN: usize = 43usize;
27584 fn deser(
27585 _version: MavlinkVersion,
27586 __input: &[u8],
27587 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27588 let avail_len = __input.len();
27589 let mut payload_buf = [0; Self::ENCODED_LEN];
27590 let mut buf = if avail_len < Self::ENCODED_LEN {
27591 payload_buf[0..avail_len].copy_from_slice(__input);
27592 Bytes::new(&payload_buf)
27593 } else {
27594 Bytes::new(__input)
27595 };
27596 let mut __struct = Self::default();
27597 __struct.time_usec = buf.get_u64_le();
27598 for v in &mut __struct.controls {
27599 let val = buf.get_f32_le();
27600 *v = val;
27601 }
27602 __struct.group_mlx = buf.get_u8();
27603 __struct.target_system = buf.get_u8();
27604 __struct.target_component = buf.get_u8();
27605 Ok(__struct)
27606 }
27607 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27608 let mut __tmp = BytesMut::new(bytes);
27609 #[allow(clippy::absurd_extreme_comparisons)]
27610 #[allow(unused_comparisons)]
27611 if __tmp.remaining() < Self::ENCODED_LEN {
27612 panic!(
27613 "buffer is too small (need {} bytes, but got {})",
27614 Self::ENCODED_LEN,
27615 __tmp.remaining(),
27616 )
27617 }
27618 __tmp.put_u64_le(self.time_usec);
27619 for val in &self.controls {
27620 __tmp.put_f32_le(*val);
27621 }
27622 __tmp.put_u8(self.group_mlx);
27623 __tmp.put_u8(self.target_system);
27624 __tmp.put_u8(self.target_component);
27625 if matches!(version, MavlinkVersion::V2) {
27626 let len = __tmp.len();
27627 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27628 } else {
27629 __tmp.len()
27630 }
27631 }
27632}
27633#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27634#[doc = ""]
27635#[doc = "ID: 82"]
27636#[derive(Debug, Clone, PartialEq)]
27637#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27638#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27639pub struct SET_ATTITUDE_TARGET_DATA {
27640 #[doc = "Timestamp (time since system boot)."]
27641 pub time_boot_ms: u32,
27642 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27643 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27644 pub q: [f32; 4],
27645 #[doc = "Body roll rate"]
27646 pub body_roll_rate: f32,
27647 #[doc = "Body pitch rate"]
27648 pub body_pitch_rate: f32,
27649 #[doc = "Body yaw rate"]
27650 pub body_yaw_rate: f32,
27651 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27652 pub thrust: f32,
27653 #[doc = "System ID"]
27654 pub target_system: u8,
27655 #[doc = "Component ID"]
27656 pub target_component: u8,
27657 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27658 pub type_mask: AttitudeTargetTypemask,
27659 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
27660 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27661 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27662 pub thrust_body: [f32; 3],
27663}
27664impl SET_ATTITUDE_TARGET_DATA {
27665 pub const ENCODED_LEN: usize = 51usize;
27666 pub const DEFAULT: Self = Self {
27667 time_boot_ms: 0_u32,
27668 q: [0.0_f32; 4usize],
27669 body_roll_rate: 0.0_f32,
27670 body_pitch_rate: 0.0_f32,
27671 body_yaw_rate: 0.0_f32,
27672 thrust: 0.0_f32,
27673 target_system: 0_u8,
27674 target_component: 0_u8,
27675 type_mask: AttitudeTargetTypemask::DEFAULT,
27676 thrust_body: [0.0_f32; 3usize],
27677 };
27678 #[cfg(feature = "arbitrary")]
27679 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27680 use arbitrary::{Arbitrary, Unstructured};
27681 let mut buf = [0u8; 1024];
27682 rng.fill_bytes(&mut buf);
27683 let mut unstructured = Unstructured::new(&buf);
27684 Self::arbitrary(&mut unstructured).unwrap_or_default()
27685 }
27686}
27687impl Default for SET_ATTITUDE_TARGET_DATA {
27688 fn default() -> Self {
27689 Self::DEFAULT.clone()
27690 }
27691}
27692impl MessageData for SET_ATTITUDE_TARGET_DATA {
27693 type Message = MavMessage;
27694 const ID: u32 = 82u32;
27695 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27696 const EXTRA_CRC: u8 = 49u8;
27697 const ENCODED_LEN: usize = 51usize;
27698 fn deser(
27699 _version: MavlinkVersion,
27700 __input: &[u8],
27701 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27702 let avail_len = __input.len();
27703 let mut payload_buf = [0; Self::ENCODED_LEN];
27704 let mut buf = if avail_len < Self::ENCODED_LEN {
27705 payload_buf[0..avail_len].copy_from_slice(__input);
27706 Bytes::new(&payload_buf)
27707 } else {
27708 Bytes::new(__input)
27709 };
27710 let mut __struct = Self::default();
27711 __struct.time_boot_ms = buf.get_u32_le();
27712 for v in &mut __struct.q {
27713 let val = buf.get_f32_le();
27714 *v = val;
27715 }
27716 __struct.body_roll_rate = buf.get_f32_le();
27717 __struct.body_pitch_rate = buf.get_f32_le();
27718 __struct.body_yaw_rate = buf.get_f32_le();
27719 __struct.thrust = buf.get_f32_le();
27720 __struct.target_system = buf.get_u8();
27721 __struct.target_component = buf.get_u8();
27722 let tmp = buf.get_u8();
27723 __struct.type_mask = AttitudeTargetTypemask::from_bits(
27724 tmp & AttitudeTargetTypemask::all().bits(),
27725 )
27726 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27727 flag_type: "AttitudeTargetTypemask",
27728 value: tmp as u32,
27729 })?;
27730 for v in &mut __struct.thrust_body {
27731 let val = buf.get_f32_le();
27732 *v = val;
27733 }
27734 Ok(__struct)
27735 }
27736 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27737 let mut __tmp = BytesMut::new(bytes);
27738 #[allow(clippy::absurd_extreme_comparisons)]
27739 #[allow(unused_comparisons)]
27740 if __tmp.remaining() < Self::ENCODED_LEN {
27741 panic!(
27742 "buffer is too small (need {} bytes, but got {})",
27743 Self::ENCODED_LEN,
27744 __tmp.remaining(),
27745 )
27746 }
27747 __tmp.put_u32_le(self.time_boot_ms);
27748 for val in &self.q {
27749 __tmp.put_f32_le(*val);
27750 }
27751 __tmp.put_f32_le(self.body_roll_rate);
27752 __tmp.put_f32_le(self.body_pitch_rate);
27753 __tmp.put_f32_le(self.body_yaw_rate);
27754 __tmp.put_f32_le(self.thrust);
27755 __tmp.put_u8(self.target_system);
27756 __tmp.put_u8(self.target_component);
27757 __tmp.put_u8(self.type_mask.bits());
27758 if matches!(version, MavlinkVersion::V2) {
27759 for val in &self.thrust_body {
27760 __tmp.put_f32_le(*val);
27761 }
27762 let len = __tmp.len();
27763 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27764 } else {
27765 __tmp.len()
27766 }
27767 }
27768}
27769#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27770#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27771#[doc = ""]
27772#[doc = "ID: 48"]
27773#[derive(Debug, Clone, PartialEq)]
27774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27776pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27777 #[doc = "Latitude (WGS84)"]
27778 pub latitude: i32,
27779 #[doc = "Longitude (WGS84)"]
27780 pub longitude: i32,
27781 #[doc = "Altitude (MSL). Positive for up."]
27782 pub altitude: i32,
27783 #[doc = "System ID"]
27784 pub target_system: u8,
27785 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27786 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27787 pub time_usec: u64,
27788}
27789impl SET_GPS_GLOBAL_ORIGIN_DATA {
27790 pub const ENCODED_LEN: usize = 21usize;
27791 pub const DEFAULT: Self = Self {
27792 latitude: 0_i32,
27793 longitude: 0_i32,
27794 altitude: 0_i32,
27795 target_system: 0_u8,
27796 time_usec: 0_u64,
27797 };
27798 #[cfg(feature = "arbitrary")]
27799 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27800 use arbitrary::{Arbitrary, Unstructured};
27801 let mut buf = [0u8; 1024];
27802 rng.fill_bytes(&mut buf);
27803 let mut unstructured = Unstructured::new(&buf);
27804 Self::arbitrary(&mut unstructured).unwrap_or_default()
27805 }
27806}
27807impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27808 fn default() -> Self {
27809 Self::DEFAULT.clone()
27810 }
27811}
27812impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27813 type Message = MavMessage;
27814 const ID: u32 = 48u32;
27815 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27816 const EXTRA_CRC: u8 = 41u8;
27817 const ENCODED_LEN: usize = 21usize;
27818 fn deser(
27819 _version: MavlinkVersion,
27820 __input: &[u8],
27821 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27822 let avail_len = __input.len();
27823 let mut payload_buf = [0; Self::ENCODED_LEN];
27824 let mut buf = if avail_len < Self::ENCODED_LEN {
27825 payload_buf[0..avail_len].copy_from_slice(__input);
27826 Bytes::new(&payload_buf)
27827 } else {
27828 Bytes::new(__input)
27829 };
27830 let mut __struct = Self::default();
27831 __struct.latitude = buf.get_i32_le();
27832 __struct.longitude = buf.get_i32_le();
27833 __struct.altitude = buf.get_i32_le();
27834 __struct.target_system = buf.get_u8();
27835 __struct.time_usec = buf.get_u64_le();
27836 Ok(__struct)
27837 }
27838 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27839 let mut __tmp = BytesMut::new(bytes);
27840 #[allow(clippy::absurd_extreme_comparisons)]
27841 #[allow(unused_comparisons)]
27842 if __tmp.remaining() < Self::ENCODED_LEN {
27843 panic!(
27844 "buffer is too small (need {} bytes, but got {})",
27845 Self::ENCODED_LEN,
27846 __tmp.remaining(),
27847 )
27848 }
27849 __tmp.put_i32_le(self.latitude);
27850 __tmp.put_i32_le(self.longitude);
27851 __tmp.put_i32_le(self.altitude);
27852 __tmp.put_u8(self.target_system);
27853 if matches!(version, MavlinkVersion::V2) {
27854 __tmp.put_u64_le(self.time_usec);
27855 let len = __tmp.len();
27856 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27857 } else {
27858 __tmp.len()
27859 }
27860 }
27861}
27862#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27863#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27864#[doc = ""]
27865#[doc = "ID: 243"]
27866#[derive(Debug, Clone, PartialEq)]
27867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27869pub struct SET_HOME_POSITION_DATA {
27870 #[doc = "Latitude (WGS84)"]
27871 pub latitude: i32,
27872 #[doc = "Longitude (WGS84)"]
27873 pub longitude: i32,
27874 #[doc = "Altitude (MSL). Positive for up."]
27875 pub altitude: i32,
27876 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27877 pub x: f32,
27878 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27879 pub y: f32,
27880 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27881 pub z: f32,
27882 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27883 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27884 pub q: [f32; 4],
27885 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27886 pub approach_x: f32,
27887 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27888 pub approach_y: f32,
27889 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27890 pub approach_z: f32,
27891 #[doc = "System ID."]
27892 pub target_system: u8,
27893 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27894 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27895 pub time_usec: u64,
27896}
27897impl SET_HOME_POSITION_DATA {
27898 pub const ENCODED_LEN: usize = 61usize;
27899 pub const DEFAULT: Self = Self {
27900 latitude: 0_i32,
27901 longitude: 0_i32,
27902 altitude: 0_i32,
27903 x: 0.0_f32,
27904 y: 0.0_f32,
27905 z: 0.0_f32,
27906 q: [0.0_f32; 4usize],
27907 approach_x: 0.0_f32,
27908 approach_y: 0.0_f32,
27909 approach_z: 0.0_f32,
27910 target_system: 0_u8,
27911 time_usec: 0_u64,
27912 };
27913 #[cfg(feature = "arbitrary")]
27914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27915 use arbitrary::{Arbitrary, Unstructured};
27916 let mut buf = [0u8; 1024];
27917 rng.fill_bytes(&mut buf);
27918 let mut unstructured = Unstructured::new(&buf);
27919 Self::arbitrary(&mut unstructured).unwrap_or_default()
27920 }
27921}
27922impl Default for SET_HOME_POSITION_DATA {
27923 fn default() -> Self {
27924 Self::DEFAULT.clone()
27925 }
27926}
27927impl MessageData for SET_HOME_POSITION_DATA {
27928 type Message = MavMessage;
27929 const ID: u32 = 243u32;
27930 const NAME: &'static str = "SET_HOME_POSITION";
27931 const EXTRA_CRC: u8 = 85u8;
27932 const ENCODED_LEN: usize = 61usize;
27933 fn deser(
27934 _version: MavlinkVersion,
27935 __input: &[u8],
27936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27937 let avail_len = __input.len();
27938 let mut payload_buf = [0; Self::ENCODED_LEN];
27939 let mut buf = if avail_len < Self::ENCODED_LEN {
27940 payload_buf[0..avail_len].copy_from_slice(__input);
27941 Bytes::new(&payload_buf)
27942 } else {
27943 Bytes::new(__input)
27944 };
27945 let mut __struct = Self::default();
27946 __struct.latitude = buf.get_i32_le();
27947 __struct.longitude = buf.get_i32_le();
27948 __struct.altitude = buf.get_i32_le();
27949 __struct.x = buf.get_f32_le();
27950 __struct.y = buf.get_f32_le();
27951 __struct.z = buf.get_f32_le();
27952 for v in &mut __struct.q {
27953 let val = buf.get_f32_le();
27954 *v = val;
27955 }
27956 __struct.approach_x = buf.get_f32_le();
27957 __struct.approach_y = buf.get_f32_le();
27958 __struct.approach_z = buf.get_f32_le();
27959 __struct.target_system = buf.get_u8();
27960 __struct.time_usec = buf.get_u64_le();
27961 Ok(__struct)
27962 }
27963 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27964 let mut __tmp = BytesMut::new(bytes);
27965 #[allow(clippy::absurd_extreme_comparisons)]
27966 #[allow(unused_comparisons)]
27967 if __tmp.remaining() < Self::ENCODED_LEN {
27968 panic!(
27969 "buffer is too small (need {} bytes, but got {})",
27970 Self::ENCODED_LEN,
27971 __tmp.remaining(),
27972 )
27973 }
27974 __tmp.put_i32_le(self.latitude);
27975 __tmp.put_i32_le(self.longitude);
27976 __tmp.put_i32_le(self.altitude);
27977 __tmp.put_f32_le(self.x);
27978 __tmp.put_f32_le(self.y);
27979 __tmp.put_f32_le(self.z);
27980 for val in &self.q {
27981 __tmp.put_f32_le(*val);
27982 }
27983 __tmp.put_f32_le(self.approach_x);
27984 __tmp.put_f32_le(self.approach_y);
27985 __tmp.put_f32_le(self.approach_z);
27986 __tmp.put_u8(self.target_system);
27987 if matches!(version, MavlinkVersion::V2) {
27988 __tmp.put_u64_le(self.time_usec);
27989 let len = __tmp.len();
27990 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27991 } else {
27992 __tmp.len()
27993 }
27994 }
27995}
27996#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27997#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27998#[doc = ""]
27999#[doc = "ID: 11"]
28000#[derive(Debug, Clone, PartialEq)]
28001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28002#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28003pub struct SET_MODE_DATA {
28004 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28005 pub custom_mode: u32,
28006 #[doc = "The system setting the mode"]
28007 pub target_system: u8,
28008 #[doc = "The new base mode."]
28009 pub base_mode: MavMode,
28010}
28011impl SET_MODE_DATA {
28012 pub const ENCODED_LEN: usize = 6usize;
28013 pub const DEFAULT: Self = Self {
28014 custom_mode: 0_u32,
28015 target_system: 0_u8,
28016 base_mode: MavMode::DEFAULT,
28017 };
28018 #[cfg(feature = "arbitrary")]
28019 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28020 use arbitrary::{Arbitrary, Unstructured};
28021 let mut buf = [0u8; 1024];
28022 rng.fill_bytes(&mut buf);
28023 let mut unstructured = Unstructured::new(&buf);
28024 Self::arbitrary(&mut unstructured).unwrap_or_default()
28025 }
28026}
28027impl Default for SET_MODE_DATA {
28028 fn default() -> Self {
28029 Self::DEFAULT.clone()
28030 }
28031}
28032impl MessageData for SET_MODE_DATA {
28033 type Message = MavMessage;
28034 const ID: u32 = 11u32;
28035 const NAME: &'static str = "SET_MODE";
28036 const EXTRA_CRC: u8 = 89u8;
28037 const ENCODED_LEN: usize = 6usize;
28038 fn deser(
28039 _version: MavlinkVersion,
28040 __input: &[u8],
28041 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28042 let avail_len = __input.len();
28043 let mut payload_buf = [0; Self::ENCODED_LEN];
28044 let mut buf = if avail_len < Self::ENCODED_LEN {
28045 payload_buf[0..avail_len].copy_from_slice(__input);
28046 Bytes::new(&payload_buf)
28047 } else {
28048 Bytes::new(__input)
28049 };
28050 let mut __struct = Self::default();
28051 __struct.custom_mode = buf.get_u32_le();
28052 __struct.target_system = buf.get_u8();
28053 let tmp = buf.get_u8();
28054 __struct.base_mode =
28055 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28056 enum_type: "MavMode",
28057 value: tmp as u32,
28058 })?;
28059 Ok(__struct)
28060 }
28061 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28062 let mut __tmp = BytesMut::new(bytes);
28063 #[allow(clippy::absurd_extreme_comparisons)]
28064 #[allow(unused_comparisons)]
28065 if __tmp.remaining() < Self::ENCODED_LEN {
28066 panic!(
28067 "buffer is too small (need {} bytes, but got {})",
28068 Self::ENCODED_LEN,
28069 __tmp.remaining(),
28070 )
28071 }
28072 __tmp.put_u32_le(self.custom_mode);
28073 __tmp.put_u8(self.target_system);
28074 __tmp.put_u8(self.base_mode as u8);
28075 if matches!(version, MavlinkVersion::V2) {
28076 let len = __tmp.len();
28077 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28078 } else {
28079 __tmp.len()
28080 }
28081 }
28082}
28083#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28084#[doc = ""]
28085#[doc = "ID: 86"]
28086#[derive(Debug, Clone, PartialEq)]
28087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28089pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28090 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28091 pub time_boot_ms: u32,
28092 #[doc = "Latitude in WGS84 frame"]
28093 pub lat_int: i32,
28094 #[doc = "Longitude in WGS84 frame"]
28095 pub lon_int: i32,
28096 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28097 pub alt: f32,
28098 #[doc = "X velocity in NED frame"]
28099 pub vx: f32,
28100 #[doc = "Y velocity in NED frame"]
28101 pub vy: f32,
28102 #[doc = "Z velocity in NED frame"]
28103 pub vz: f32,
28104 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28105 pub afx: f32,
28106 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28107 pub afy: f32,
28108 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28109 pub afz: f32,
28110 #[doc = "yaw setpoint"]
28111 pub yaw: f32,
28112 #[doc = "yaw rate setpoint"]
28113 pub yaw_rate: f32,
28114 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28115 pub type_mask: PositionTargetTypemask,
28116 #[doc = "System ID"]
28117 pub target_system: u8,
28118 #[doc = "Component ID"]
28119 pub target_component: u8,
28120 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28121 pub coordinate_frame: MavFrame,
28122}
28123impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28124 pub const ENCODED_LEN: usize = 53usize;
28125 pub const DEFAULT: Self = Self {
28126 time_boot_ms: 0_u32,
28127 lat_int: 0_i32,
28128 lon_int: 0_i32,
28129 alt: 0.0_f32,
28130 vx: 0.0_f32,
28131 vy: 0.0_f32,
28132 vz: 0.0_f32,
28133 afx: 0.0_f32,
28134 afy: 0.0_f32,
28135 afz: 0.0_f32,
28136 yaw: 0.0_f32,
28137 yaw_rate: 0.0_f32,
28138 type_mask: PositionTargetTypemask::DEFAULT,
28139 target_system: 0_u8,
28140 target_component: 0_u8,
28141 coordinate_frame: MavFrame::DEFAULT,
28142 };
28143 #[cfg(feature = "arbitrary")]
28144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28145 use arbitrary::{Arbitrary, Unstructured};
28146 let mut buf = [0u8; 1024];
28147 rng.fill_bytes(&mut buf);
28148 let mut unstructured = Unstructured::new(&buf);
28149 Self::arbitrary(&mut unstructured).unwrap_or_default()
28150 }
28151}
28152impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28153 fn default() -> Self {
28154 Self::DEFAULT.clone()
28155 }
28156}
28157impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28158 type Message = MavMessage;
28159 const ID: u32 = 86u32;
28160 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28161 const EXTRA_CRC: u8 = 5u8;
28162 const ENCODED_LEN: usize = 53usize;
28163 fn deser(
28164 _version: MavlinkVersion,
28165 __input: &[u8],
28166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28167 let avail_len = __input.len();
28168 let mut payload_buf = [0; Self::ENCODED_LEN];
28169 let mut buf = if avail_len < Self::ENCODED_LEN {
28170 payload_buf[0..avail_len].copy_from_slice(__input);
28171 Bytes::new(&payload_buf)
28172 } else {
28173 Bytes::new(__input)
28174 };
28175 let mut __struct = Self::default();
28176 __struct.time_boot_ms = buf.get_u32_le();
28177 __struct.lat_int = buf.get_i32_le();
28178 __struct.lon_int = buf.get_i32_le();
28179 __struct.alt = buf.get_f32_le();
28180 __struct.vx = buf.get_f32_le();
28181 __struct.vy = buf.get_f32_le();
28182 __struct.vz = buf.get_f32_le();
28183 __struct.afx = buf.get_f32_le();
28184 __struct.afy = buf.get_f32_le();
28185 __struct.afz = buf.get_f32_le();
28186 __struct.yaw = buf.get_f32_le();
28187 __struct.yaw_rate = buf.get_f32_le();
28188 let tmp = buf.get_u16_le();
28189 __struct.type_mask = PositionTargetTypemask::from_bits(
28190 tmp & PositionTargetTypemask::all().bits(),
28191 )
28192 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28193 flag_type: "PositionTargetTypemask",
28194 value: tmp as u32,
28195 })?;
28196 __struct.target_system = buf.get_u8();
28197 __struct.target_component = buf.get_u8();
28198 let tmp = buf.get_u8();
28199 __struct.coordinate_frame =
28200 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28201 enum_type: "MavFrame",
28202 value: tmp as u32,
28203 })?;
28204 Ok(__struct)
28205 }
28206 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28207 let mut __tmp = BytesMut::new(bytes);
28208 #[allow(clippy::absurd_extreme_comparisons)]
28209 #[allow(unused_comparisons)]
28210 if __tmp.remaining() < Self::ENCODED_LEN {
28211 panic!(
28212 "buffer is too small (need {} bytes, but got {})",
28213 Self::ENCODED_LEN,
28214 __tmp.remaining(),
28215 )
28216 }
28217 __tmp.put_u32_le(self.time_boot_ms);
28218 __tmp.put_i32_le(self.lat_int);
28219 __tmp.put_i32_le(self.lon_int);
28220 __tmp.put_f32_le(self.alt);
28221 __tmp.put_f32_le(self.vx);
28222 __tmp.put_f32_le(self.vy);
28223 __tmp.put_f32_le(self.vz);
28224 __tmp.put_f32_le(self.afx);
28225 __tmp.put_f32_le(self.afy);
28226 __tmp.put_f32_le(self.afz);
28227 __tmp.put_f32_le(self.yaw);
28228 __tmp.put_f32_le(self.yaw_rate);
28229 __tmp.put_u16_le(self.type_mask.bits());
28230 __tmp.put_u8(self.target_system);
28231 __tmp.put_u8(self.target_component);
28232 __tmp.put_u8(self.coordinate_frame as u8);
28233 if matches!(version, MavlinkVersion::V2) {
28234 let len = __tmp.len();
28235 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28236 } else {
28237 __tmp.len()
28238 }
28239 }
28240}
28241#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28242#[doc = ""]
28243#[doc = "ID: 84"]
28244#[derive(Debug, Clone, PartialEq)]
28245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28247pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28248 #[doc = "Timestamp (time since system boot)."]
28249 pub time_boot_ms: u32,
28250 #[doc = "X Position in NED frame"]
28251 pub x: f32,
28252 #[doc = "Y Position in NED frame"]
28253 pub y: f32,
28254 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28255 pub z: f32,
28256 #[doc = "X velocity in NED frame"]
28257 pub vx: f32,
28258 #[doc = "Y velocity in NED frame"]
28259 pub vy: f32,
28260 #[doc = "Z velocity in NED frame"]
28261 pub vz: f32,
28262 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28263 pub afx: f32,
28264 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28265 pub afy: f32,
28266 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28267 pub afz: f32,
28268 #[doc = "yaw setpoint"]
28269 pub yaw: f32,
28270 #[doc = "yaw rate setpoint"]
28271 pub yaw_rate: f32,
28272 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28273 pub type_mask: PositionTargetTypemask,
28274 #[doc = "System ID"]
28275 pub target_system: u8,
28276 #[doc = "Component ID"]
28277 pub target_component: u8,
28278 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28279 pub coordinate_frame: MavFrame,
28280}
28281impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28282 pub const ENCODED_LEN: usize = 53usize;
28283 pub const DEFAULT: Self = Self {
28284 time_boot_ms: 0_u32,
28285 x: 0.0_f32,
28286 y: 0.0_f32,
28287 z: 0.0_f32,
28288 vx: 0.0_f32,
28289 vy: 0.0_f32,
28290 vz: 0.0_f32,
28291 afx: 0.0_f32,
28292 afy: 0.0_f32,
28293 afz: 0.0_f32,
28294 yaw: 0.0_f32,
28295 yaw_rate: 0.0_f32,
28296 type_mask: PositionTargetTypemask::DEFAULT,
28297 target_system: 0_u8,
28298 target_component: 0_u8,
28299 coordinate_frame: MavFrame::DEFAULT,
28300 };
28301 #[cfg(feature = "arbitrary")]
28302 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28303 use arbitrary::{Arbitrary, Unstructured};
28304 let mut buf = [0u8; 1024];
28305 rng.fill_bytes(&mut buf);
28306 let mut unstructured = Unstructured::new(&buf);
28307 Self::arbitrary(&mut unstructured).unwrap_or_default()
28308 }
28309}
28310impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28311 fn default() -> Self {
28312 Self::DEFAULT.clone()
28313 }
28314}
28315impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28316 type Message = MavMessage;
28317 const ID: u32 = 84u32;
28318 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28319 const EXTRA_CRC: u8 = 143u8;
28320 const ENCODED_LEN: usize = 53usize;
28321 fn deser(
28322 _version: MavlinkVersion,
28323 __input: &[u8],
28324 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28325 let avail_len = __input.len();
28326 let mut payload_buf = [0; Self::ENCODED_LEN];
28327 let mut buf = if avail_len < Self::ENCODED_LEN {
28328 payload_buf[0..avail_len].copy_from_slice(__input);
28329 Bytes::new(&payload_buf)
28330 } else {
28331 Bytes::new(__input)
28332 };
28333 let mut __struct = Self::default();
28334 __struct.time_boot_ms = buf.get_u32_le();
28335 __struct.x = buf.get_f32_le();
28336 __struct.y = buf.get_f32_le();
28337 __struct.z = buf.get_f32_le();
28338 __struct.vx = buf.get_f32_le();
28339 __struct.vy = buf.get_f32_le();
28340 __struct.vz = buf.get_f32_le();
28341 __struct.afx = buf.get_f32_le();
28342 __struct.afy = buf.get_f32_le();
28343 __struct.afz = buf.get_f32_le();
28344 __struct.yaw = buf.get_f32_le();
28345 __struct.yaw_rate = buf.get_f32_le();
28346 let tmp = buf.get_u16_le();
28347 __struct.type_mask = PositionTargetTypemask::from_bits(
28348 tmp & PositionTargetTypemask::all().bits(),
28349 )
28350 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28351 flag_type: "PositionTargetTypemask",
28352 value: tmp as u32,
28353 })?;
28354 __struct.target_system = buf.get_u8();
28355 __struct.target_component = buf.get_u8();
28356 let tmp = buf.get_u8();
28357 __struct.coordinate_frame =
28358 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28359 enum_type: "MavFrame",
28360 value: tmp as u32,
28361 })?;
28362 Ok(__struct)
28363 }
28364 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28365 let mut __tmp = BytesMut::new(bytes);
28366 #[allow(clippy::absurd_extreme_comparisons)]
28367 #[allow(unused_comparisons)]
28368 if __tmp.remaining() < Self::ENCODED_LEN {
28369 panic!(
28370 "buffer is too small (need {} bytes, but got {})",
28371 Self::ENCODED_LEN,
28372 __tmp.remaining(),
28373 )
28374 }
28375 __tmp.put_u32_le(self.time_boot_ms);
28376 __tmp.put_f32_le(self.x);
28377 __tmp.put_f32_le(self.y);
28378 __tmp.put_f32_le(self.z);
28379 __tmp.put_f32_le(self.vx);
28380 __tmp.put_f32_le(self.vy);
28381 __tmp.put_f32_le(self.vz);
28382 __tmp.put_f32_le(self.afx);
28383 __tmp.put_f32_le(self.afy);
28384 __tmp.put_f32_le(self.afz);
28385 __tmp.put_f32_le(self.yaw);
28386 __tmp.put_f32_le(self.yaw_rate);
28387 __tmp.put_u16_le(self.type_mask.bits());
28388 __tmp.put_u8(self.target_system);
28389 __tmp.put_u8(self.target_component);
28390 __tmp.put_u8(self.coordinate_frame as u8);
28391 if matches!(version, MavlinkVersion::V2) {
28392 let len = __tmp.len();
28393 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28394 } else {
28395 __tmp.len()
28396 }
28397 }
28398}
28399#[doc = "Status of simulation environment, if used."]
28400#[doc = ""]
28401#[doc = "ID: 108"]
28402#[derive(Debug, Clone, PartialEq)]
28403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28404#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28405pub struct SIM_STATE_DATA {
28406 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28407 pub q1: f32,
28408 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28409 pub q2: f32,
28410 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28411 pub q3: f32,
28412 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28413 pub q4: f32,
28414 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28415 pub roll: f32,
28416 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28417 pub pitch: f32,
28418 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28419 pub yaw: f32,
28420 #[doc = "X acceleration"]
28421 pub xacc: f32,
28422 #[doc = "Y acceleration"]
28423 pub yacc: f32,
28424 #[doc = "Z acceleration"]
28425 pub zacc: f32,
28426 #[doc = "Angular speed around X axis"]
28427 pub xgyro: f32,
28428 #[doc = "Angular speed around Y axis"]
28429 pub ygyro: f32,
28430 #[doc = "Angular speed around Z axis"]
28431 pub zgyro: f32,
28432 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28433 pub lat: f32,
28434 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28435 pub lon: f32,
28436 #[doc = "Altitude"]
28437 pub alt: f32,
28438 #[doc = "Horizontal position standard deviation"]
28439 pub std_dev_horz: f32,
28440 #[doc = "Vertical position standard deviation"]
28441 pub std_dev_vert: f32,
28442 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28443 pub vn: f32,
28444 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28445 pub ve: f32,
28446 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28447 pub vd: f32,
28448 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28449 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28450 pub lat_int: i32,
28451 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28452 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28453 pub lon_int: i32,
28454}
28455impl SIM_STATE_DATA {
28456 pub const ENCODED_LEN: usize = 92usize;
28457 pub const DEFAULT: Self = Self {
28458 q1: 0.0_f32,
28459 q2: 0.0_f32,
28460 q3: 0.0_f32,
28461 q4: 0.0_f32,
28462 roll: 0.0_f32,
28463 pitch: 0.0_f32,
28464 yaw: 0.0_f32,
28465 xacc: 0.0_f32,
28466 yacc: 0.0_f32,
28467 zacc: 0.0_f32,
28468 xgyro: 0.0_f32,
28469 ygyro: 0.0_f32,
28470 zgyro: 0.0_f32,
28471 lat: 0.0_f32,
28472 lon: 0.0_f32,
28473 alt: 0.0_f32,
28474 std_dev_horz: 0.0_f32,
28475 std_dev_vert: 0.0_f32,
28476 vn: 0.0_f32,
28477 ve: 0.0_f32,
28478 vd: 0.0_f32,
28479 lat_int: 0_i32,
28480 lon_int: 0_i32,
28481 };
28482 #[cfg(feature = "arbitrary")]
28483 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28484 use arbitrary::{Arbitrary, Unstructured};
28485 let mut buf = [0u8; 1024];
28486 rng.fill_bytes(&mut buf);
28487 let mut unstructured = Unstructured::new(&buf);
28488 Self::arbitrary(&mut unstructured).unwrap_or_default()
28489 }
28490}
28491impl Default for SIM_STATE_DATA {
28492 fn default() -> Self {
28493 Self::DEFAULT.clone()
28494 }
28495}
28496impl MessageData for SIM_STATE_DATA {
28497 type Message = MavMessage;
28498 const ID: u32 = 108u32;
28499 const NAME: &'static str = "SIM_STATE";
28500 const EXTRA_CRC: u8 = 32u8;
28501 const ENCODED_LEN: usize = 92usize;
28502 fn deser(
28503 _version: MavlinkVersion,
28504 __input: &[u8],
28505 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28506 let avail_len = __input.len();
28507 let mut payload_buf = [0; Self::ENCODED_LEN];
28508 let mut buf = if avail_len < Self::ENCODED_LEN {
28509 payload_buf[0..avail_len].copy_from_slice(__input);
28510 Bytes::new(&payload_buf)
28511 } else {
28512 Bytes::new(__input)
28513 };
28514 let mut __struct = Self::default();
28515 __struct.q1 = buf.get_f32_le();
28516 __struct.q2 = buf.get_f32_le();
28517 __struct.q3 = buf.get_f32_le();
28518 __struct.q4 = buf.get_f32_le();
28519 __struct.roll = buf.get_f32_le();
28520 __struct.pitch = buf.get_f32_le();
28521 __struct.yaw = buf.get_f32_le();
28522 __struct.xacc = buf.get_f32_le();
28523 __struct.yacc = buf.get_f32_le();
28524 __struct.zacc = buf.get_f32_le();
28525 __struct.xgyro = buf.get_f32_le();
28526 __struct.ygyro = buf.get_f32_le();
28527 __struct.zgyro = buf.get_f32_le();
28528 __struct.lat = buf.get_f32_le();
28529 __struct.lon = buf.get_f32_le();
28530 __struct.alt = buf.get_f32_le();
28531 __struct.std_dev_horz = buf.get_f32_le();
28532 __struct.std_dev_vert = buf.get_f32_le();
28533 __struct.vn = buf.get_f32_le();
28534 __struct.ve = buf.get_f32_le();
28535 __struct.vd = buf.get_f32_le();
28536 __struct.lat_int = buf.get_i32_le();
28537 __struct.lon_int = buf.get_i32_le();
28538 Ok(__struct)
28539 }
28540 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28541 let mut __tmp = BytesMut::new(bytes);
28542 #[allow(clippy::absurd_extreme_comparisons)]
28543 #[allow(unused_comparisons)]
28544 if __tmp.remaining() < Self::ENCODED_LEN {
28545 panic!(
28546 "buffer is too small (need {} bytes, but got {})",
28547 Self::ENCODED_LEN,
28548 __tmp.remaining(),
28549 )
28550 }
28551 __tmp.put_f32_le(self.q1);
28552 __tmp.put_f32_le(self.q2);
28553 __tmp.put_f32_le(self.q3);
28554 __tmp.put_f32_le(self.q4);
28555 __tmp.put_f32_le(self.roll);
28556 __tmp.put_f32_le(self.pitch);
28557 __tmp.put_f32_le(self.yaw);
28558 __tmp.put_f32_le(self.xacc);
28559 __tmp.put_f32_le(self.yacc);
28560 __tmp.put_f32_le(self.zacc);
28561 __tmp.put_f32_le(self.xgyro);
28562 __tmp.put_f32_le(self.ygyro);
28563 __tmp.put_f32_le(self.zgyro);
28564 __tmp.put_f32_le(self.lat);
28565 __tmp.put_f32_le(self.lon);
28566 __tmp.put_f32_le(self.alt);
28567 __tmp.put_f32_le(self.std_dev_horz);
28568 __tmp.put_f32_le(self.std_dev_vert);
28569 __tmp.put_f32_le(self.vn);
28570 __tmp.put_f32_le(self.ve);
28571 __tmp.put_f32_le(self.vd);
28572 if matches!(version, MavlinkVersion::V2) {
28573 __tmp.put_i32_le(self.lat_int);
28574 __tmp.put_i32_le(self.lon_int);
28575 let len = __tmp.len();
28576 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28577 } else {
28578 __tmp.len()
28579 }
28580 }
28581}
28582#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28583#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28584#[doc = ""]
28585#[doc = "ID: 370"]
28586#[derive(Debug, Clone, PartialEq)]
28587#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28588#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28589pub struct SMART_BATTERY_INFO_DATA {
28590 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28591 pub capacity_full_specification: i32,
28592 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28593 pub capacity_full: i32,
28594 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28595 pub cycle_count: u16,
28596 #[doc = "Battery weight. 0: field not provided."]
28597 pub weight: u16,
28598 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28599 pub discharge_minimum_voltage: u16,
28600 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28601 pub charging_minimum_voltage: u16,
28602 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28603 pub resting_minimum_voltage: u16,
28604 #[doc = "Battery ID"]
28605 pub id: u8,
28606 #[doc = "Function of the battery"]
28607 pub battery_function: MavBatteryFunction,
28608 #[doc = "Type (chemistry) of the battery"]
28609 pub mavtype: MavBatteryType,
28610 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28611 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28612 pub serial_number: [u8; 16],
28613 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28614 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28615 pub device_name: [u8; 50],
28616 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28617 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28618 pub charging_maximum_voltage: u16,
28619 #[doc = "Number of battery cells in series. 0: field not provided."]
28620 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28621 pub cells_in_series: u8,
28622 #[doc = "Maximum pack discharge current. 0: field not provided."]
28623 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28624 pub discharge_maximum_current: u32,
28625 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28626 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28627 pub discharge_maximum_burst_current: u32,
28628 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28629 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28630 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28631 pub manufacture_date: [u8; 11],
28632}
28633impl SMART_BATTERY_INFO_DATA {
28634 pub const ENCODED_LEN: usize = 109usize;
28635 pub const DEFAULT: Self = Self {
28636 capacity_full_specification: 0_i32,
28637 capacity_full: 0_i32,
28638 cycle_count: 0_u16,
28639 weight: 0_u16,
28640 discharge_minimum_voltage: 0_u16,
28641 charging_minimum_voltage: 0_u16,
28642 resting_minimum_voltage: 0_u16,
28643 id: 0_u8,
28644 battery_function: MavBatteryFunction::DEFAULT,
28645 mavtype: MavBatteryType::DEFAULT,
28646 serial_number: [0_u8; 16usize],
28647 device_name: [0_u8; 50usize],
28648 charging_maximum_voltage: 0_u16,
28649 cells_in_series: 0_u8,
28650 discharge_maximum_current: 0_u32,
28651 discharge_maximum_burst_current: 0_u32,
28652 manufacture_date: [0_u8; 11usize],
28653 };
28654 #[cfg(feature = "arbitrary")]
28655 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28656 use arbitrary::{Arbitrary, Unstructured};
28657 let mut buf = [0u8; 1024];
28658 rng.fill_bytes(&mut buf);
28659 let mut unstructured = Unstructured::new(&buf);
28660 Self::arbitrary(&mut unstructured).unwrap_or_default()
28661 }
28662}
28663impl Default for SMART_BATTERY_INFO_DATA {
28664 fn default() -> Self {
28665 Self::DEFAULT.clone()
28666 }
28667}
28668impl MessageData for SMART_BATTERY_INFO_DATA {
28669 type Message = MavMessage;
28670 const ID: u32 = 370u32;
28671 const NAME: &'static str = "SMART_BATTERY_INFO";
28672 const EXTRA_CRC: u8 = 75u8;
28673 const ENCODED_LEN: usize = 109usize;
28674 fn deser(
28675 _version: MavlinkVersion,
28676 __input: &[u8],
28677 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28678 let avail_len = __input.len();
28679 let mut payload_buf = [0; Self::ENCODED_LEN];
28680 let mut buf = if avail_len < Self::ENCODED_LEN {
28681 payload_buf[0..avail_len].copy_from_slice(__input);
28682 Bytes::new(&payload_buf)
28683 } else {
28684 Bytes::new(__input)
28685 };
28686 let mut __struct = Self::default();
28687 __struct.capacity_full_specification = buf.get_i32_le();
28688 __struct.capacity_full = buf.get_i32_le();
28689 __struct.cycle_count = buf.get_u16_le();
28690 __struct.weight = buf.get_u16_le();
28691 __struct.discharge_minimum_voltage = buf.get_u16_le();
28692 __struct.charging_minimum_voltage = buf.get_u16_le();
28693 __struct.resting_minimum_voltage = buf.get_u16_le();
28694 __struct.id = buf.get_u8();
28695 let tmp = buf.get_u8();
28696 __struct.battery_function =
28697 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28698 enum_type: "MavBatteryFunction",
28699 value: tmp as u32,
28700 })?;
28701 let tmp = buf.get_u8();
28702 __struct.mavtype =
28703 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28704 enum_type: "MavBatteryType",
28705 value: tmp as u32,
28706 })?;
28707 for v in &mut __struct.serial_number {
28708 let val = buf.get_u8();
28709 *v = val;
28710 }
28711 for v in &mut __struct.device_name {
28712 let val = buf.get_u8();
28713 *v = val;
28714 }
28715 __struct.charging_maximum_voltage = buf.get_u16_le();
28716 __struct.cells_in_series = buf.get_u8();
28717 __struct.discharge_maximum_current = buf.get_u32_le();
28718 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28719 for v in &mut __struct.manufacture_date {
28720 let val = buf.get_u8();
28721 *v = val;
28722 }
28723 Ok(__struct)
28724 }
28725 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28726 let mut __tmp = BytesMut::new(bytes);
28727 #[allow(clippy::absurd_extreme_comparisons)]
28728 #[allow(unused_comparisons)]
28729 if __tmp.remaining() < Self::ENCODED_LEN {
28730 panic!(
28731 "buffer is too small (need {} bytes, but got {})",
28732 Self::ENCODED_LEN,
28733 __tmp.remaining(),
28734 )
28735 }
28736 __tmp.put_i32_le(self.capacity_full_specification);
28737 __tmp.put_i32_le(self.capacity_full);
28738 __tmp.put_u16_le(self.cycle_count);
28739 __tmp.put_u16_le(self.weight);
28740 __tmp.put_u16_le(self.discharge_minimum_voltage);
28741 __tmp.put_u16_le(self.charging_minimum_voltage);
28742 __tmp.put_u16_le(self.resting_minimum_voltage);
28743 __tmp.put_u8(self.id);
28744 __tmp.put_u8(self.battery_function as u8);
28745 __tmp.put_u8(self.mavtype as u8);
28746 for val in &self.serial_number {
28747 __tmp.put_u8(*val);
28748 }
28749 for val in &self.device_name {
28750 __tmp.put_u8(*val);
28751 }
28752 if matches!(version, MavlinkVersion::V2) {
28753 __tmp.put_u16_le(self.charging_maximum_voltage);
28754 __tmp.put_u8(self.cells_in_series);
28755 __tmp.put_u32_le(self.discharge_maximum_current);
28756 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28757 for val in &self.manufacture_date {
28758 __tmp.put_u8(*val);
28759 }
28760 let len = __tmp.len();
28761 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28762 } else {
28763 __tmp.len()
28764 }
28765 }
28766}
28767#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28768#[doc = ""]
28769#[doc = "ID: 253"]
28770#[derive(Debug, Clone, PartialEq)]
28771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28773pub struct STATUSTEXT_DATA {
28774 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28775 pub severity: MavSeverity,
28776 #[doc = "Status text message, without null termination character"]
28777 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28778 pub text: [u8; 50],
28779 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28780 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28781 pub id: u16,
28782 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28783 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28784 pub chunk_seq: u8,
28785}
28786impl STATUSTEXT_DATA {
28787 pub const ENCODED_LEN: usize = 54usize;
28788 pub const DEFAULT: Self = Self {
28789 severity: MavSeverity::DEFAULT,
28790 text: [0_u8; 50usize],
28791 id: 0_u16,
28792 chunk_seq: 0_u8,
28793 };
28794 #[cfg(feature = "arbitrary")]
28795 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28796 use arbitrary::{Arbitrary, Unstructured};
28797 let mut buf = [0u8; 1024];
28798 rng.fill_bytes(&mut buf);
28799 let mut unstructured = Unstructured::new(&buf);
28800 Self::arbitrary(&mut unstructured).unwrap_or_default()
28801 }
28802}
28803impl Default for STATUSTEXT_DATA {
28804 fn default() -> Self {
28805 Self::DEFAULT.clone()
28806 }
28807}
28808impl MessageData for STATUSTEXT_DATA {
28809 type Message = MavMessage;
28810 const ID: u32 = 253u32;
28811 const NAME: &'static str = "STATUSTEXT";
28812 const EXTRA_CRC: u8 = 83u8;
28813 const ENCODED_LEN: usize = 54usize;
28814 fn deser(
28815 _version: MavlinkVersion,
28816 __input: &[u8],
28817 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28818 let avail_len = __input.len();
28819 let mut payload_buf = [0; Self::ENCODED_LEN];
28820 let mut buf = if avail_len < Self::ENCODED_LEN {
28821 payload_buf[0..avail_len].copy_from_slice(__input);
28822 Bytes::new(&payload_buf)
28823 } else {
28824 Bytes::new(__input)
28825 };
28826 let mut __struct = Self::default();
28827 let tmp = buf.get_u8();
28828 __struct.severity =
28829 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28830 enum_type: "MavSeverity",
28831 value: tmp as u32,
28832 })?;
28833 for v in &mut __struct.text {
28834 let val = buf.get_u8();
28835 *v = val;
28836 }
28837 __struct.id = buf.get_u16_le();
28838 __struct.chunk_seq = buf.get_u8();
28839 Ok(__struct)
28840 }
28841 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28842 let mut __tmp = BytesMut::new(bytes);
28843 #[allow(clippy::absurd_extreme_comparisons)]
28844 #[allow(unused_comparisons)]
28845 if __tmp.remaining() < Self::ENCODED_LEN {
28846 panic!(
28847 "buffer is too small (need {} bytes, but got {})",
28848 Self::ENCODED_LEN,
28849 __tmp.remaining(),
28850 )
28851 }
28852 __tmp.put_u8(self.severity as u8);
28853 for val in &self.text {
28854 __tmp.put_u8(*val);
28855 }
28856 if matches!(version, MavlinkVersion::V2) {
28857 __tmp.put_u16_le(self.id);
28858 __tmp.put_u8(self.chunk_seq);
28859 let len = __tmp.len();
28860 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28861 } else {
28862 __tmp.len()
28863 }
28864 }
28865}
28866#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28867#[doc = ""]
28868#[doc = "ID: 261"]
28869#[derive(Debug, Clone, PartialEq)]
28870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28872pub struct STORAGE_INFORMATION_DATA {
28873 #[doc = "Timestamp (time since system boot)."]
28874 pub time_boot_ms: u32,
28875 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28876 pub total_capacity: f32,
28877 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28878 pub used_capacity: f32,
28879 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28880 pub available_capacity: f32,
28881 #[doc = "Read speed."]
28882 pub read_speed: f32,
28883 #[doc = "Write speed."]
28884 pub write_speed: f32,
28885 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28886 pub storage_id: u8,
28887 #[doc = "Number of storage devices"]
28888 pub storage_count: u8,
28889 #[doc = "Status of storage"]
28890 pub status: StorageStatus,
28891 #[doc = "Type of storage"]
28892 #[cfg_attr(feature = "serde", serde(default))]
28893 pub mavtype: StorageType,
28894 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28895 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28896 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28897 pub name: [u8; 32],
28898 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28899 #[cfg_attr(feature = "serde", serde(default))]
28900 pub storage_usage: StorageUsageFlag,
28901}
28902impl STORAGE_INFORMATION_DATA {
28903 pub const ENCODED_LEN: usize = 61usize;
28904 pub const DEFAULT: Self = Self {
28905 time_boot_ms: 0_u32,
28906 total_capacity: 0.0_f32,
28907 used_capacity: 0.0_f32,
28908 available_capacity: 0.0_f32,
28909 read_speed: 0.0_f32,
28910 write_speed: 0.0_f32,
28911 storage_id: 0_u8,
28912 storage_count: 0_u8,
28913 status: StorageStatus::DEFAULT,
28914 mavtype: StorageType::DEFAULT,
28915 name: [0_u8; 32usize],
28916 storage_usage: StorageUsageFlag::DEFAULT,
28917 };
28918 #[cfg(feature = "arbitrary")]
28919 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28920 use arbitrary::{Arbitrary, Unstructured};
28921 let mut buf = [0u8; 1024];
28922 rng.fill_bytes(&mut buf);
28923 let mut unstructured = Unstructured::new(&buf);
28924 Self::arbitrary(&mut unstructured).unwrap_or_default()
28925 }
28926}
28927impl Default for STORAGE_INFORMATION_DATA {
28928 fn default() -> Self {
28929 Self::DEFAULT.clone()
28930 }
28931}
28932impl MessageData for STORAGE_INFORMATION_DATA {
28933 type Message = MavMessage;
28934 const ID: u32 = 261u32;
28935 const NAME: &'static str = "STORAGE_INFORMATION";
28936 const EXTRA_CRC: u8 = 179u8;
28937 const ENCODED_LEN: usize = 61usize;
28938 fn deser(
28939 _version: MavlinkVersion,
28940 __input: &[u8],
28941 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28942 let avail_len = __input.len();
28943 let mut payload_buf = [0; Self::ENCODED_LEN];
28944 let mut buf = if avail_len < Self::ENCODED_LEN {
28945 payload_buf[0..avail_len].copy_from_slice(__input);
28946 Bytes::new(&payload_buf)
28947 } else {
28948 Bytes::new(__input)
28949 };
28950 let mut __struct = Self::default();
28951 __struct.time_boot_ms = buf.get_u32_le();
28952 __struct.total_capacity = buf.get_f32_le();
28953 __struct.used_capacity = buf.get_f32_le();
28954 __struct.available_capacity = buf.get_f32_le();
28955 __struct.read_speed = buf.get_f32_le();
28956 __struct.write_speed = buf.get_f32_le();
28957 __struct.storage_id = buf.get_u8();
28958 __struct.storage_count = buf.get_u8();
28959 let tmp = buf.get_u8();
28960 __struct.status =
28961 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28962 enum_type: "StorageStatus",
28963 value: tmp as u32,
28964 })?;
28965 let tmp = buf.get_u8();
28966 __struct.mavtype =
28967 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28968 enum_type: "StorageType",
28969 value: tmp as u32,
28970 })?;
28971 for v in &mut __struct.name {
28972 let val = buf.get_u8();
28973 *v = val;
28974 }
28975 let tmp = buf.get_u8();
28976 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28977 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28978 flag_type: "StorageUsageFlag",
28979 value: tmp as u32,
28980 })?;
28981 Ok(__struct)
28982 }
28983 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28984 let mut __tmp = BytesMut::new(bytes);
28985 #[allow(clippy::absurd_extreme_comparisons)]
28986 #[allow(unused_comparisons)]
28987 if __tmp.remaining() < Self::ENCODED_LEN {
28988 panic!(
28989 "buffer is too small (need {} bytes, but got {})",
28990 Self::ENCODED_LEN,
28991 __tmp.remaining(),
28992 )
28993 }
28994 __tmp.put_u32_le(self.time_boot_ms);
28995 __tmp.put_f32_le(self.total_capacity);
28996 __tmp.put_f32_le(self.used_capacity);
28997 __tmp.put_f32_le(self.available_capacity);
28998 __tmp.put_f32_le(self.read_speed);
28999 __tmp.put_f32_le(self.write_speed);
29000 __tmp.put_u8(self.storage_id);
29001 __tmp.put_u8(self.storage_count);
29002 __tmp.put_u8(self.status as u8);
29003 if matches!(version, MavlinkVersion::V2) {
29004 __tmp.put_u8(self.mavtype as u8);
29005 for val in &self.name {
29006 __tmp.put_u8(*val);
29007 }
29008 __tmp.put_u8(self.storage_usage.bits());
29009 let len = __tmp.len();
29010 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29011 } else {
29012 __tmp.len()
29013 }
29014 }
29015}
29016#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29017#[doc = ""]
29018#[doc = "ID: 401"]
29019#[derive(Debug, Clone, PartialEq)]
29020#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29021#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29022pub struct SUPPORTED_TUNES_DATA {
29023 #[doc = "Bitfield of supported tune formats."]
29024 pub format: TuneFormat,
29025 #[doc = "System ID"]
29026 pub target_system: u8,
29027 #[doc = "Component ID"]
29028 pub target_component: u8,
29029}
29030impl SUPPORTED_TUNES_DATA {
29031 pub const ENCODED_LEN: usize = 6usize;
29032 pub const DEFAULT: Self = Self {
29033 format: TuneFormat::DEFAULT,
29034 target_system: 0_u8,
29035 target_component: 0_u8,
29036 };
29037 #[cfg(feature = "arbitrary")]
29038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29039 use arbitrary::{Arbitrary, Unstructured};
29040 let mut buf = [0u8; 1024];
29041 rng.fill_bytes(&mut buf);
29042 let mut unstructured = Unstructured::new(&buf);
29043 Self::arbitrary(&mut unstructured).unwrap_or_default()
29044 }
29045}
29046impl Default for SUPPORTED_TUNES_DATA {
29047 fn default() -> Self {
29048 Self::DEFAULT.clone()
29049 }
29050}
29051impl MessageData for SUPPORTED_TUNES_DATA {
29052 type Message = MavMessage;
29053 const ID: u32 = 401u32;
29054 const NAME: &'static str = "SUPPORTED_TUNES";
29055 const EXTRA_CRC: u8 = 183u8;
29056 const ENCODED_LEN: usize = 6usize;
29057 fn deser(
29058 _version: MavlinkVersion,
29059 __input: &[u8],
29060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29061 let avail_len = __input.len();
29062 let mut payload_buf = [0; Self::ENCODED_LEN];
29063 let mut buf = if avail_len < Self::ENCODED_LEN {
29064 payload_buf[0..avail_len].copy_from_slice(__input);
29065 Bytes::new(&payload_buf)
29066 } else {
29067 Bytes::new(__input)
29068 };
29069 let mut __struct = Self::default();
29070 let tmp = buf.get_u32_le();
29071 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29072 ::mavlink_core::error::ParserError::InvalidEnum {
29073 enum_type: "TuneFormat",
29074 value: tmp as u32,
29075 },
29076 )?;
29077 __struct.target_system = buf.get_u8();
29078 __struct.target_component = buf.get_u8();
29079 Ok(__struct)
29080 }
29081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29082 let mut __tmp = BytesMut::new(bytes);
29083 #[allow(clippy::absurd_extreme_comparisons)]
29084 #[allow(unused_comparisons)]
29085 if __tmp.remaining() < Self::ENCODED_LEN {
29086 panic!(
29087 "buffer is too small (need {} bytes, but got {})",
29088 Self::ENCODED_LEN,
29089 __tmp.remaining(),
29090 )
29091 }
29092 __tmp.put_u32_le(self.format as u32);
29093 __tmp.put_u8(self.target_system);
29094 __tmp.put_u8(self.target_component);
29095 if matches!(version, MavlinkVersion::V2) {
29096 let len = __tmp.len();
29097 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29098 } else {
29099 __tmp.len()
29100 }
29101 }
29102}
29103#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29104#[doc = ""]
29105#[doc = "ID: 2"]
29106#[derive(Debug, Clone, PartialEq)]
29107#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29108#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29109pub struct SYSTEM_TIME_DATA {
29110 #[doc = "Timestamp (UNIX epoch time)."]
29111 pub time_unix_usec: u64,
29112 #[doc = "Timestamp (time since system boot)."]
29113 pub time_boot_ms: u32,
29114}
29115impl SYSTEM_TIME_DATA {
29116 pub const ENCODED_LEN: usize = 12usize;
29117 pub const DEFAULT: Self = Self {
29118 time_unix_usec: 0_u64,
29119 time_boot_ms: 0_u32,
29120 };
29121 #[cfg(feature = "arbitrary")]
29122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29123 use arbitrary::{Arbitrary, Unstructured};
29124 let mut buf = [0u8; 1024];
29125 rng.fill_bytes(&mut buf);
29126 let mut unstructured = Unstructured::new(&buf);
29127 Self::arbitrary(&mut unstructured).unwrap_or_default()
29128 }
29129}
29130impl Default for SYSTEM_TIME_DATA {
29131 fn default() -> Self {
29132 Self::DEFAULT.clone()
29133 }
29134}
29135impl MessageData for SYSTEM_TIME_DATA {
29136 type Message = MavMessage;
29137 const ID: u32 = 2u32;
29138 const NAME: &'static str = "SYSTEM_TIME";
29139 const EXTRA_CRC: u8 = 137u8;
29140 const ENCODED_LEN: usize = 12usize;
29141 fn deser(
29142 _version: MavlinkVersion,
29143 __input: &[u8],
29144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29145 let avail_len = __input.len();
29146 let mut payload_buf = [0; Self::ENCODED_LEN];
29147 let mut buf = if avail_len < Self::ENCODED_LEN {
29148 payload_buf[0..avail_len].copy_from_slice(__input);
29149 Bytes::new(&payload_buf)
29150 } else {
29151 Bytes::new(__input)
29152 };
29153 let mut __struct = Self::default();
29154 __struct.time_unix_usec = buf.get_u64_le();
29155 __struct.time_boot_ms = buf.get_u32_le();
29156 Ok(__struct)
29157 }
29158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29159 let mut __tmp = BytesMut::new(bytes);
29160 #[allow(clippy::absurd_extreme_comparisons)]
29161 #[allow(unused_comparisons)]
29162 if __tmp.remaining() < Self::ENCODED_LEN {
29163 panic!(
29164 "buffer is too small (need {} bytes, but got {})",
29165 Self::ENCODED_LEN,
29166 __tmp.remaining(),
29167 )
29168 }
29169 __tmp.put_u64_le(self.time_unix_usec);
29170 __tmp.put_u32_le(self.time_boot_ms);
29171 if matches!(version, MavlinkVersion::V2) {
29172 let len = __tmp.len();
29173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29174 } else {
29175 __tmp.len()
29176 }
29177 }
29178}
29179#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29180#[doc = ""]
29181#[doc = "ID: 1"]
29182#[derive(Debug, Clone, PartialEq)]
29183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29185pub struct SYS_STATUS_DATA {
29186 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29187 pub onboard_control_sensors_present: MavSysStatusSensor,
29188 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29189 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29190 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29191 pub onboard_control_sensors_health: MavSysStatusSensor,
29192 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29193 pub load: u16,
29194 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29195 pub voltage_battery: u16,
29196 #[doc = "Battery current, -1: Current not sent by autopilot"]
29197 pub current_battery: i16,
29198 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29199 pub drop_rate_comm: u16,
29200 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29201 pub errors_comm: u16,
29202 #[doc = "Autopilot-specific errors"]
29203 pub errors_count1: u16,
29204 #[doc = "Autopilot-specific errors"]
29205 pub errors_count2: u16,
29206 #[doc = "Autopilot-specific errors"]
29207 pub errors_count3: u16,
29208 #[doc = "Autopilot-specific errors"]
29209 pub errors_count4: u16,
29210 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29211 pub battery_remaining: i8,
29212 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29213 #[cfg_attr(feature = "serde", serde(default))]
29214 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29215 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29216 #[cfg_attr(feature = "serde", serde(default))]
29217 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29218 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29219 #[cfg_attr(feature = "serde", serde(default))]
29220 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29221}
29222impl SYS_STATUS_DATA {
29223 pub const ENCODED_LEN: usize = 43usize;
29224 pub const DEFAULT: Self = Self {
29225 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29226 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29227 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29228 load: 0_u16,
29229 voltage_battery: 0_u16,
29230 current_battery: 0_i16,
29231 drop_rate_comm: 0_u16,
29232 errors_comm: 0_u16,
29233 errors_count1: 0_u16,
29234 errors_count2: 0_u16,
29235 errors_count3: 0_u16,
29236 errors_count4: 0_u16,
29237 battery_remaining: 0_i8,
29238 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29239 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29240 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29241 };
29242 #[cfg(feature = "arbitrary")]
29243 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29244 use arbitrary::{Arbitrary, Unstructured};
29245 let mut buf = [0u8; 1024];
29246 rng.fill_bytes(&mut buf);
29247 let mut unstructured = Unstructured::new(&buf);
29248 Self::arbitrary(&mut unstructured).unwrap_or_default()
29249 }
29250}
29251impl Default for SYS_STATUS_DATA {
29252 fn default() -> Self {
29253 Self::DEFAULT.clone()
29254 }
29255}
29256impl MessageData for SYS_STATUS_DATA {
29257 type Message = MavMessage;
29258 const ID: u32 = 1u32;
29259 const NAME: &'static str = "SYS_STATUS";
29260 const EXTRA_CRC: u8 = 124u8;
29261 const ENCODED_LEN: usize = 43usize;
29262 fn deser(
29263 _version: MavlinkVersion,
29264 __input: &[u8],
29265 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29266 let avail_len = __input.len();
29267 let mut payload_buf = [0; Self::ENCODED_LEN];
29268 let mut buf = if avail_len < Self::ENCODED_LEN {
29269 payload_buf[0..avail_len].copy_from_slice(__input);
29270 Bytes::new(&payload_buf)
29271 } else {
29272 Bytes::new(__input)
29273 };
29274 let mut __struct = Self::default();
29275 let tmp = buf.get_u32_le();
29276 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
29277 tmp & MavSysStatusSensor::all().bits(),
29278 )
29279 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29280 flag_type: "MavSysStatusSensor",
29281 value: tmp as u32,
29282 })?;
29283 let tmp = buf.get_u32_le();
29284 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
29285 tmp & MavSysStatusSensor::all().bits(),
29286 )
29287 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29288 flag_type: "MavSysStatusSensor",
29289 value: tmp as u32,
29290 })?;
29291 let tmp = buf.get_u32_le();
29292 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
29293 tmp & MavSysStatusSensor::all().bits(),
29294 )
29295 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29296 flag_type: "MavSysStatusSensor",
29297 value: tmp as u32,
29298 })?;
29299 __struct.load = buf.get_u16_le();
29300 __struct.voltage_battery = buf.get_u16_le();
29301 __struct.current_battery = buf.get_i16_le();
29302 __struct.drop_rate_comm = buf.get_u16_le();
29303 __struct.errors_comm = buf.get_u16_le();
29304 __struct.errors_count1 = buf.get_u16_le();
29305 __struct.errors_count2 = buf.get_u16_le();
29306 __struct.errors_count3 = buf.get_u16_le();
29307 __struct.errors_count4 = buf.get_u16_le();
29308 __struct.battery_remaining = buf.get_i8();
29309 let tmp = buf.get_u32_le();
29310 __struct.onboard_control_sensors_present_extended =
29311 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29312 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29313 flag_type: "MavSysStatusSensorExtended",
29314 value: tmp as u32,
29315 })?;
29316 let tmp = buf.get_u32_le();
29317 __struct.onboard_control_sensors_enabled_extended =
29318 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29319 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29320 flag_type: "MavSysStatusSensorExtended",
29321 value: tmp as u32,
29322 })?;
29323 let tmp = buf.get_u32_le();
29324 __struct.onboard_control_sensors_health_extended =
29325 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29326 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29327 flag_type: "MavSysStatusSensorExtended",
29328 value: tmp as u32,
29329 })?;
29330 Ok(__struct)
29331 }
29332 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29333 let mut __tmp = BytesMut::new(bytes);
29334 #[allow(clippy::absurd_extreme_comparisons)]
29335 #[allow(unused_comparisons)]
29336 if __tmp.remaining() < Self::ENCODED_LEN {
29337 panic!(
29338 "buffer is too small (need {} bytes, but got {})",
29339 Self::ENCODED_LEN,
29340 __tmp.remaining(),
29341 )
29342 }
29343 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
29344 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
29345 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
29346 __tmp.put_u16_le(self.load);
29347 __tmp.put_u16_le(self.voltage_battery);
29348 __tmp.put_i16_le(self.current_battery);
29349 __tmp.put_u16_le(self.drop_rate_comm);
29350 __tmp.put_u16_le(self.errors_comm);
29351 __tmp.put_u16_le(self.errors_count1);
29352 __tmp.put_u16_le(self.errors_count2);
29353 __tmp.put_u16_le(self.errors_count3);
29354 __tmp.put_u16_le(self.errors_count4);
29355 __tmp.put_i8(self.battery_remaining);
29356 if matches!(version, MavlinkVersion::V2) {
29357 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
29358 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
29359 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
29360 let len = __tmp.len();
29361 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29362 } else {
29363 __tmp.len()
29364 }
29365 }
29366}
29367#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
29368#[doc = ""]
29369#[doc = "ID: 135"]
29370#[derive(Debug, Clone, PartialEq)]
29371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29373pub struct TERRAIN_CHECK_DATA {
29374 #[doc = "Latitude"]
29375 pub lat: i32,
29376 #[doc = "Longitude"]
29377 pub lon: i32,
29378}
29379impl TERRAIN_CHECK_DATA {
29380 pub const ENCODED_LEN: usize = 8usize;
29381 pub const DEFAULT: Self = Self {
29382 lat: 0_i32,
29383 lon: 0_i32,
29384 };
29385 #[cfg(feature = "arbitrary")]
29386 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29387 use arbitrary::{Arbitrary, Unstructured};
29388 let mut buf = [0u8; 1024];
29389 rng.fill_bytes(&mut buf);
29390 let mut unstructured = Unstructured::new(&buf);
29391 Self::arbitrary(&mut unstructured).unwrap_or_default()
29392 }
29393}
29394impl Default for TERRAIN_CHECK_DATA {
29395 fn default() -> Self {
29396 Self::DEFAULT.clone()
29397 }
29398}
29399impl MessageData for TERRAIN_CHECK_DATA {
29400 type Message = MavMessage;
29401 const ID: u32 = 135u32;
29402 const NAME: &'static str = "TERRAIN_CHECK";
29403 const EXTRA_CRC: u8 = 203u8;
29404 const ENCODED_LEN: usize = 8usize;
29405 fn deser(
29406 _version: MavlinkVersion,
29407 __input: &[u8],
29408 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29409 let avail_len = __input.len();
29410 let mut payload_buf = [0; Self::ENCODED_LEN];
29411 let mut buf = if avail_len < Self::ENCODED_LEN {
29412 payload_buf[0..avail_len].copy_from_slice(__input);
29413 Bytes::new(&payload_buf)
29414 } else {
29415 Bytes::new(__input)
29416 };
29417 let mut __struct = Self::default();
29418 __struct.lat = buf.get_i32_le();
29419 __struct.lon = buf.get_i32_le();
29420 Ok(__struct)
29421 }
29422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29423 let mut __tmp = BytesMut::new(bytes);
29424 #[allow(clippy::absurd_extreme_comparisons)]
29425 #[allow(unused_comparisons)]
29426 if __tmp.remaining() < Self::ENCODED_LEN {
29427 panic!(
29428 "buffer is too small (need {} bytes, but got {})",
29429 Self::ENCODED_LEN,
29430 __tmp.remaining(),
29431 )
29432 }
29433 __tmp.put_i32_le(self.lat);
29434 __tmp.put_i32_le(self.lon);
29435 if matches!(version, MavlinkVersion::V2) {
29436 let len = __tmp.len();
29437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29438 } else {
29439 __tmp.len()
29440 }
29441 }
29442}
29443#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29444#[doc = ""]
29445#[doc = "ID: 134"]
29446#[derive(Debug, Clone, PartialEq)]
29447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29449pub struct TERRAIN_DATA_DATA {
29450 #[doc = "Latitude of SW corner of first grid"]
29451 pub lat: i32,
29452 #[doc = "Longitude of SW corner of first grid"]
29453 pub lon: i32,
29454 #[doc = "Grid spacing"]
29455 pub grid_spacing: u16,
29456 #[doc = "Terrain data MSL"]
29457 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29458 pub data: [i16; 16],
29459 #[doc = "bit within the terrain request mask"]
29460 pub gridbit: u8,
29461}
29462impl TERRAIN_DATA_DATA {
29463 pub const ENCODED_LEN: usize = 43usize;
29464 pub const DEFAULT: Self = Self {
29465 lat: 0_i32,
29466 lon: 0_i32,
29467 grid_spacing: 0_u16,
29468 data: [0_i16; 16usize],
29469 gridbit: 0_u8,
29470 };
29471 #[cfg(feature = "arbitrary")]
29472 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29473 use arbitrary::{Arbitrary, Unstructured};
29474 let mut buf = [0u8; 1024];
29475 rng.fill_bytes(&mut buf);
29476 let mut unstructured = Unstructured::new(&buf);
29477 Self::arbitrary(&mut unstructured).unwrap_or_default()
29478 }
29479}
29480impl Default for TERRAIN_DATA_DATA {
29481 fn default() -> Self {
29482 Self::DEFAULT.clone()
29483 }
29484}
29485impl MessageData for TERRAIN_DATA_DATA {
29486 type Message = MavMessage;
29487 const ID: u32 = 134u32;
29488 const NAME: &'static str = "TERRAIN_DATA";
29489 const EXTRA_CRC: u8 = 229u8;
29490 const ENCODED_LEN: usize = 43usize;
29491 fn deser(
29492 _version: MavlinkVersion,
29493 __input: &[u8],
29494 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29495 let avail_len = __input.len();
29496 let mut payload_buf = [0; Self::ENCODED_LEN];
29497 let mut buf = if avail_len < Self::ENCODED_LEN {
29498 payload_buf[0..avail_len].copy_from_slice(__input);
29499 Bytes::new(&payload_buf)
29500 } else {
29501 Bytes::new(__input)
29502 };
29503 let mut __struct = Self::default();
29504 __struct.lat = buf.get_i32_le();
29505 __struct.lon = buf.get_i32_le();
29506 __struct.grid_spacing = buf.get_u16_le();
29507 for v in &mut __struct.data {
29508 let val = buf.get_i16_le();
29509 *v = val;
29510 }
29511 __struct.gridbit = buf.get_u8();
29512 Ok(__struct)
29513 }
29514 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29515 let mut __tmp = BytesMut::new(bytes);
29516 #[allow(clippy::absurd_extreme_comparisons)]
29517 #[allow(unused_comparisons)]
29518 if __tmp.remaining() < Self::ENCODED_LEN {
29519 panic!(
29520 "buffer is too small (need {} bytes, but got {})",
29521 Self::ENCODED_LEN,
29522 __tmp.remaining(),
29523 )
29524 }
29525 __tmp.put_i32_le(self.lat);
29526 __tmp.put_i32_le(self.lon);
29527 __tmp.put_u16_le(self.grid_spacing);
29528 for val in &self.data {
29529 __tmp.put_i16_le(*val);
29530 }
29531 __tmp.put_u8(self.gridbit);
29532 if matches!(version, MavlinkVersion::V2) {
29533 let len = __tmp.len();
29534 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29535 } else {
29536 __tmp.len()
29537 }
29538 }
29539}
29540#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29541#[doc = ""]
29542#[doc = "ID: 136"]
29543#[derive(Debug, Clone, PartialEq)]
29544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29546pub struct TERRAIN_REPORT_DATA {
29547 #[doc = "Latitude"]
29548 pub lat: i32,
29549 #[doc = "Longitude"]
29550 pub lon: i32,
29551 #[doc = "Terrain height MSL"]
29552 pub terrain_height: f32,
29553 #[doc = "Current vehicle height above lat/lon terrain height"]
29554 pub current_height: f32,
29555 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29556 pub spacing: u16,
29557 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29558 pub pending: u16,
29559 #[doc = "Number of 4x4 terrain blocks in memory"]
29560 pub loaded: u16,
29561}
29562impl TERRAIN_REPORT_DATA {
29563 pub const ENCODED_LEN: usize = 22usize;
29564 pub const DEFAULT: Self = Self {
29565 lat: 0_i32,
29566 lon: 0_i32,
29567 terrain_height: 0.0_f32,
29568 current_height: 0.0_f32,
29569 spacing: 0_u16,
29570 pending: 0_u16,
29571 loaded: 0_u16,
29572 };
29573 #[cfg(feature = "arbitrary")]
29574 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29575 use arbitrary::{Arbitrary, Unstructured};
29576 let mut buf = [0u8; 1024];
29577 rng.fill_bytes(&mut buf);
29578 let mut unstructured = Unstructured::new(&buf);
29579 Self::arbitrary(&mut unstructured).unwrap_or_default()
29580 }
29581}
29582impl Default for TERRAIN_REPORT_DATA {
29583 fn default() -> Self {
29584 Self::DEFAULT.clone()
29585 }
29586}
29587impl MessageData for TERRAIN_REPORT_DATA {
29588 type Message = MavMessage;
29589 const ID: u32 = 136u32;
29590 const NAME: &'static str = "TERRAIN_REPORT";
29591 const EXTRA_CRC: u8 = 1u8;
29592 const ENCODED_LEN: usize = 22usize;
29593 fn deser(
29594 _version: MavlinkVersion,
29595 __input: &[u8],
29596 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29597 let avail_len = __input.len();
29598 let mut payload_buf = [0; Self::ENCODED_LEN];
29599 let mut buf = if avail_len < Self::ENCODED_LEN {
29600 payload_buf[0..avail_len].copy_from_slice(__input);
29601 Bytes::new(&payload_buf)
29602 } else {
29603 Bytes::new(__input)
29604 };
29605 let mut __struct = Self::default();
29606 __struct.lat = buf.get_i32_le();
29607 __struct.lon = buf.get_i32_le();
29608 __struct.terrain_height = buf.get_f32_le();
29609 __struct.current_height = buf.get_f32_le();
29610 __struct.spacing = buf.get_u16_le();
29611 __struct.pending = buf.get_u16_le();
29612 __struct.loaded = buf.get_u16_le();
29613 Ok(__struct)
29614 }
29615 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29616 let mut __tmp = BytesMut::new(bytes);
29617 #[allow(clippy::absurd_extreme_comparisons)]
29618 #[allow(unused_comparisons)]
29619 if __tmp.remaining() < Self::ENCODED_LEN {
29620 panic!(
29621 "buffer is too small (need {} bytes, but got {})",
29622 Self::ENCODED_LEN,
29623 __tmp.remaining(),
29624 )
29625 }
29626 __tmp.put_i32_le(self.lat);
29627 __tmp.put_i32_le(self.lon);
29628 __tmp.put_f32_le(self.terrain_height);
29629 __tmp.put_f32_le(self.current_height);
29630 __tmp.put_u16_le(self.spacing);
29631 __tmp.put_u16_le(self.pending);
29632 __tmp.put_u16_le(self.loaded);
29633 if matches!(version, MavlinkVersion::V2) {
29634 let len = __tmp.len();
29635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29636 } else {
29637 __tmp.len()
29638 }
29639 }
29640}
29641#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29642#[doc = ""]
29643#[doc = "ID: 133"]
29644#[derive(Debug, Clone, PartialEq)]
29645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29647pub struct TERRAIN_REQUEST_DATA {
29648 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
29649 pub mask: u64,
29650 #[doc = "Latitude of SW corner of first grid"]
29651 pub lat: i32,
29652 #[doc = "Longitude of SW corner of first grid"]
29653 pub lon: i32,
29654 #[doc = "Grid spacing"]
29655 pub grid_spacing: u16,
29656}
29657impl TERRAIN_REQUEST_DATA {
29658 pub const ENCODED_LEN: usize = 18usize;
29659 pub const DEFAULT: Self = Self {
29660 mask: 0_u64,
29661 lat: 0_i32,
29662 lon: 0_i32,
29663 grid_spacing: 0_u16,
29664 };
29665 #[cfg(feature = "arbitrary")]
29666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29667 use arbitrary::{Arbitrary, Unstructured};
29668 let mut buf = [0u8; 1024];
29669 rng.fill_bytes(&mut buf);
29670 let mut unstructured = Unstructured::new(&buf);
29671 Self::arbitrary(&mut unstructured).unwrap_or_default()
29672 }
29673}
29674impl Default for TERRAIN_REQUEST_DATA {
29675 fn default() -> Self {
29676 Self::DEFAULT.clone()
29677 }
29678}
29679impl MessageData for TERRAIN_REQUEST_DATA {
29680 type Message = MavMessage;
29681 const ID: u32 = 133u32;
29682 const NAME: &'static str = "TERRAIN_REQUEST";
29683 const EXTRA_CRC: u8 = 6u8;
29684 const ENCODED_LEN: usize = 18usize;
29685 fn deser(
29686 _version: MavlinkVersion,
29687 __input: &[u8],
29688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29689 let avail_len = __input.len();
29690 let mut payload_buf = [0; Self::ENCODED_LEN];
29691 let mut buf = if avail_len < Self::ENCODED_LEN {
29692 payload_buf[0..avail_len].copy_from_slice(__input);
29693 Bytes::new(&payload_buf)
29694 } else {
29695 Bytes::new(__input)
29696 };
29697 let mut __struct = Self::default();
29698 __struct.mask = buf.get_u64_le();
29699 __struct.lat = buf.get_i32_le();
29700 __struct.lon = buf.get_i32_le();
29701 __struct.grid_spacing = buf.get_u16_le();
29702 Ok(__struct)
29703 }
29704 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29705 let mut __tmp = BytesMut::new(bytes);
29706 #[allow(clippy::absurd_extreme_comparisons)]
29707 #[allow(unused_comparisons)]
29708 if __tmp.remaining() < Self::ENCODED_LEN {
29709 panic!(
29710 "buffer is too small (need {} bytes, but got {})",
29711 Self::ENCODED_LEN,
29712 __tmp.remaining(),
29713 )
29714 }
29715 __tmp.put_u64_le(self.mask);
29716 __tmp.put_i32_le(self.lat);
29717 __tmp.put_i32_le(self.lon);
29718 __tmp.put_u16_le(self.grid_spacing);
29719 if matches!(version, MavlinkVersion::V2) {
29720 let len = __tmp.len();
29721 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29722 } else {
29723 __tmp.len()
29724 }
29725 }
29726}
29727#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29728#[doc = ""]
29729#[doc = "ID: 111"]
29730#[derive(Debug, Clone, PartialEq)]
29731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29733pub struct TIMESYNC_DATA {
29734 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29735 pub tc1: i64,
29736 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29737 pub ts1: i64,
29738 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29739 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29740 pub target_system: u8,
29741 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29742 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29743 pub target_component: u8,
29744}
29745impl TIMESYNC_DATA {
29746 pub const ENCODED_LEN: usize = 18usize;
29747 pub const DEFAULT: Self = Self {
29748 tc1: 0_i64,
29749 ts1: 0_i64,
29750 target_system: 0_u8,
29751 target_component: 0_u8,
29752 };
29753 #[cfg(feature = "arbitrary")]
29754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29755 use arbitrary::{Arbitrary, Unstructured};
29756 let mut buf = [0u8; 1024];
29757 rng.fill_bytes(&mut buf);
29758 let mut unstructured = Unstructured::new(&buf);
29759 Self::arbitrary(&mut unstructured).unwrap_or_default()
29760 }
29761}
29762impl Default for TIMESYNC_DATA {
29763 fn default() -> Self {
29764 Self::DEFAULT.clone()
29765 }
29766}
29767impl MessageData for TIMESYNC_DATA {
29768 type Message = MavMessage;
29769 const ID: u32 = 111u32;
29770 const NAME: &'static str = "TIMESYNC";
29771 const EXTRA_CRC: u8 = 34u8;
29772 const ENCODED_LEN: usize = 18usize;
29773 fn deser(
29774 _version: MavlinkVersion,
29775 __input: &[u8],
29776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29777 let avail_len = __input.len();
29778 let mut payload_buf = [0; Self::ENCODED_LEN];
29779 let mut buf = if avail_len < Self::ENCODED_LEN {
29780 payload_buf[0..avail_len].copy_from_slice(__input);
29781 Bytes::new(&payload_buf)
29782 } else {
29783 Bytes::new(__input)
29784 };
29785 let mut __struct = Self::default();
29786 __struct.tc1 = buf.get_i64_le();
29787 __struct.ts1 = buf.get_i64_le();
29788 __struct.target_system = buf.get_u8();
29789 __struct.target_component = buf.get_u8();
29790 Ok(__struct)
29791 }
29792 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29793 let mut __tmp = BytesMut::new(bytes);
29794 #[allow(clippy::absurd_extreme_comparisons)]
29795 #[allow(unused_comparisons)]
29796 if __tmp.remaining() < Self::ENCODED_LEN {
29797 panic!(
29798 "buffer is too small (need {} bytes, but got {})",
29799 Self::ENCODED_LEN,
29800 __tmp.remaining(),
29801 )
29802 }
29803 __tmp.put_i64_le(self.tc1);
29804 __tmp.put_i64_le(self.ts1);
29805 if matches!(version, MavlinkVersion::V2) {
29806 __tmp.put_u8(self.target_system);
29807 __tmp.put_u8(self.target_component);
29808 let len = __tmp.len();
29809 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29810 } else {
29811 __tmp.len()
29812 }
29813 }
29814}
29815#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
29816#[doc = ""]
29817#[doc = "ID: 380"]
29818#[derive(Debug, Clone, PartialEq)]
29819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29821pub struct TIME_ESTIMATE_TO_TARGET_DATA {
29822 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
29823 pub safe_return: i32,
29824 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
29825 pub land: i32,
29826 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
29827 pub mission_next_item: i32,
29828 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
29829 pub mission_end: i32,
29830 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
29831 pub commanded_action: i32,
29832}
29833impl TIME_ESTIMATE_TO_TARGET_DATA {
29834 pub const ENCODED_LEN: usize = 20usize;
29835 pub const DEFAULT: Self = Self {
29836 safe_return: 0_i32,
29837 land: 0_i32,
29838 mission_next_item: 0_i32,
29839 mission_end: 0_i32,
29840 commanded_action: 0_i32,
29841 };
29842 #[cfg(feature = "arbitrary")]
29843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29844 use arbitrary::{Arbitrary, Unstructured};
29845 let mut buf = [0u8; 1024];
29846 rng.fill_bytes(&mut buf);
29847 let mut unstructured = Unstructured::new(&buf);
29848 Self::arbitrary(&mut unstructured).unwrap_or_default()
29849 }
29850}
29851impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
29852 fn default() -> Self {
29853 Self::DEFAULT.clone()
29854 }
29855}
29856impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
29857 type Message = MavMessage;
29858 const ID: u32 = 380u32;
29859 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
29860 const EXTRA_CRC: u8 = 232u8;
29861 const ENCODED_LEN: usize = 20usize;
29862 fn deser(
29863 _version: MavlinkVersion,
29864 __input: &[u8],
29865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29866 let avail_len = __input.len();
29867 let mut payload_buf = [0; Self::ENCODED_LEN];
29868 let mut buf = if avail_len < Self::ENCODED_LEN {
29869 payload_buf[0..avail_len].copy_from_slice(__input);
29870 Bytes::new(&payload_buf)
29871 } else {
29872 Bytes::new(__input)
29873 };
29874 let mut __struct = Self::default();
29875 __struct.safe_return = buf.get_i32_le();
29876 __struct.land = buf.get_i32_le();
29877 __struct.mission_next_item = buf.get_i32_le();
29878 __struct.mission_end = buf.get_i32_le();
29879 __struct.commanded_action = buf.get_i32_le();
29880 Ok(__struct)
29881 }
29882 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29883 let mut __tmp = BytesMut::new(bytes);
29884 #[allow(clippy::absurd_extreme_comparisons)]
29885 #[allow(unused_comparisons)]
29886 if __tmp.remaining() < Self::ENCODED_LEN {
29887 panic!(
29888 "buffer is too small (need {} bytes, but got {})",
29889 Self::ENCODED_LEN,
29890 __tmp.remaining(),
29891 )
29892 }
29893 __tmp.put_i32_le(self.safe_return);
29894 __tmp.put_i32_le(self.land);
29895 __tmp.put_i32_le(self.mission_next_item);
29896 __tmp.put_i32_le(self.mission_end);
29897 __tmp.put_i32_le(self.commanded_action);
29898 if matches!(version, MavlinkVersion::V2) {
29899 let len = __tmp.len();
29900 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29901 } else {
29902 __tmp.len()
29903 }
29904 }
29905}
29906#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29907#[doc = ""]
29908#[doc = "ID: 333"]
29909#[derive(Debug, Clone, PartialEq)]
29910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29912pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29913 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29914 pub time_usec: u64,
29915 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29916 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29917 pub pos_x: [f32; 5],
29918 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29919 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29920 pub pos_y: [f32; 5],
29921 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29922 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29923 pub pos_z: [f32; 5],
29924 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29925 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29926 pub delta: [f32; 5],
29927 #[doc = "Yaw. Set to NaN for unchanged"]
29928 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29929 pub pos_yaw: [f32; 5],
29930 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29931 pub valid_points: u8,
29932}
29933impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29934 pub const ENCODED_LEN: usize = 109usize;
29935 pub const DEFAULT: Self = Self {
29936 time_usec: 0_u64,
29937 pos_x: [0.0_f32; 5usize],
29938 pos_y: [0.0_f32; 5usize],
29939 pos_z: [0.0_f32; 5usize],
29940 delta: [0.0_f32; 5usize],
29941 pos_yaw: [0.0_f32; 5usize],
29942 valid_points: 0_u8,
29943 };
29944 #[cfg(feature = "arbitrary")]
29945 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29946 use arbitrary::{Arbitrary, Unstructured};
29947 let mut buf = [0u8; 1024];
29948 rng.fill_bytes(&mut buf);
29949 let mut unstructured = Unstructured::new(&buf);
29950 Self::arbitrary(&mut unstructured).unwrap_or_default()
29951 }
29952}
29953impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29954 fn default() -> Self {
29955 Self::DEFAULT.clone()
29956 }
29957}
29958impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29959 type Message = MavMessage;
29960 const ID: u32 = 333u32;
29961 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29962 const EXTRA_CRC: u8 = 231u8;
29963 const ENCODED_LEN: usize = 109usize;
29964 fn deser(
29965 _version: MavlinkVersion,
29966 __input: &[u8],
29967 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29968 let avail_len = __input.len();
29969 let mut payload_buf = [0; Self::ENCODED_LEN];
29970 let mut buf = if avail_len < Self::ENCODED_LEN {
29971 payload_buf[0..avail_len].copy_from_slice(__input);
29972 Bytes::new(&payload_buf)
29973 } else {
29974 Bytes::new(__input)
29975 };
29976 let mut __struct = Self::default();
29977 __struct.time_usec = buf.get_u64_le();
29978 for v in &mut __struct.pos_x {
29979 let val = buf.get_f32_le();
29980 *v = val;
29981 }
29982 for v in &mut __struct.pos_y {
29983 let val = buf.get_f32_le();
29984 *v = val;
29985 }
29986 for v in &mut __struct.pos_z {
29987 let val = buf.get_f32_le();
29988 *v = val;
29989 }
29990 for v in &mut __struct.delta {
29991 let val = buf.get_f32_le();
29992 *v = val;
29993 }
29994 for v in &mut __struct.pos_yaw {
29995 let val = buf.get_f32_le();
29996 *v = val;
29997 }
29998 __struct.valid_points = buf.get_u8();
29999 Ok(__struct)
30000 }
30001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30002 let mut __tmp = BytesMut::new(bytes);
30003 #[allow(clippy::absurd_extreme_comparisons)]
30004 #[allow(unused_comparisons)]
30005 if __tmp.remaining() < Self::ENCODED_LEN {
30006 panic!(
30007 "buffer is too small (need {} bytes, but got {})",
30008 Self::ENCODED_LEN,
30009 __tmp.remaining(),
30010 )
30011 }
30012 __tmp.put_u64_le(self.time_usec);
30013 for val in &self.pos_x {
30014 __tmp.put_f32_le(*val);
30015 }
30016 for val in &self.pos_y {
30017 __tmp.put_f32_le(*val);
30018 }
30019 for val in &self.pos_z {
30020 __tmp.put_f32_le(*val);
30021 }
30022 for val in &self.delta {
30023 __tmp.put_f32_le(*val);
30024 }
30025 for val in &self.pos_yaw {
30026 __tmp.put_f32_le(*val);
30027 }
30028 __tmp.put_u8(self.valid_points);
30029 if matches!(version, MavlinkVersion::V2) {
30030 let len = __tmp.len();
30031 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30032 } else {
30033 __tmp.len()
30034 }
30035 }
30036}
30037#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30038#[doc = ""]
30039#[doc = "ID: 332"]
30040#[derive(Debug, Clone, PartialEq)]
30041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30043pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30044 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30045 pub time_usec: u64,
30046 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30048 pub pos_x: [f32; 5],
30049 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30050 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30051 pub pos_y: [f32; 5],
30052 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30053 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30054 pub pos_z: [f32; 5],
30055 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30056 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30057 pub vel_x: [f32; 5],
30058 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30059 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30060 pub vel_y: [f32; 5],
30061 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30062 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30063 pub vel_z: [f32; 5],
30064 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30065 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30066 pub acc_x: [f32; 5],
30067 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30068 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30069 pub acc_y: [f32; 5],
30070 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30071 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30072 pub acc_z: [f32; 5],
30073 #[doc = "Yaw angle, set to NaN if not being used"]
30074 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30075 pub pos_yaw: [f32; 5],
30076 #[doc = "Yaw rate, set to NaN if not being used"]
30077 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30078 pub vel_yaw: [f32; 5],
30079 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30080 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30081 pub command: [u16; 5],
30082 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30083 pub valid_points: u8,
30084}
30085impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30086 pub const ENCODED_LEN: usize = 239usize;
30087 pub const DEFAULT: Self = Self {
30088 time_usec: 0_u64,
30089 pos_x: [0.0_f32; 5usize],
30090 pos_y: [0.0_f32; 5usize],
30091 pos_z: [0.0_f32; 5usize],
30092 vel_x: [0.0_f32; 5usize],
30093 vel_y: [0.0_f32; 5usize],
30094 vel_z: [0.0_f32; 5usize],
30095 acc_x: [0.0_f32; 5usize],
30096 acc_y: [0.0_f32; 5usize],
30097 acc_z: [0.0_f32; 5usize],
30098 pos_yaw: [0.0_f32; 5usize],
30099 vel_yaw: [0.0_f32; 5usize],
30100 command: [0_u16; 5usize],
30101 valid_points: 0_u8,
30102 };
30103 #[cfg(feature = "arbitrary")]
30104 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30105 use arbitrary::{Arbitrary, Unstructured};
30106 let mut buf = [0u8; 1024];
30107 rng.fill_bytes(&mut buf);
30108 let mut unstructured = Unstructured::new(&buf);
30109 Self::arbitrary(&mut unstructured).unwrap_or_default()
30110 }
30111}
30112impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30113 fn default() -> Self {
30114 Self::DEFAULT.clone()
30115 }
30116}
30117impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30118 type Message = MavMessage;
30119 const ID: u32 = 332u32;
30120 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30121 const EXTRA_CRC: u8 = 236u8;
30122 const ENCODED_LEN: usize = 239usize;
30123 fn deser(
30124 _version: MavlinkVersion,
30125 __input: &[u8],
30126 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30127 let avail_len = __input.len();
30128 let mut payload_buf = [0; Self::ENCODED_LEN];
30129 let mut buf = if avail_len < Self::ENCODED_LEN {
30130 payload_buf[0..avail_len].copy_from_slice(__input);
30131 Bytes::new(&payload_buf)
30132 } else {
30133 Bytes::new(__input)
30134 };
30135 let mut __struct = Self::default();
30136 __struct.time_usec = buf.get_u64_le();
30137 for v in &mut __struct.pos_x {
30138 let val = buf.get_f32_le();
30139 *v = val;
30140 }
30141 for v in &mut __struct.pos_y {
30142 let val = buf.get_f32_le();
30143 *v = val;
30144 }
30145 for v in &mut __struct.pos_z {
30146 let val = buf.get_f32_le();
30147 *v = val;
30148 }
30149 for v in &mut __struct.vel_x {
30150 let val = buf.get_f32_le();
30151 *v = val;
30152 }
30153 for v in &mut __struct.vel_y {
30154 let val = buf.get_f32_le();
30155 *v = val;
30156 }
30157 for v in &mut __struct.vel_z {
30158 let val = buf.get_f32_le();
30159 *v = val;
30160 }
30161 for v in &mut __struct.acc_x {
30162 let val = buf.get_f32_le();
30163 *v = val;
30164 }
30165 for v in &mut __struct.acc_y {
30166 let val = buf.get_f32_le();
30167 *v = val;
30168 }
30169 for v in &mut __struct.acc_z {
30170 let val = buf.get_f32_le();
30171 *v = val;
30172 }
30173 for v in &mut __struct.pos_yaw {
30174 let val = buf.get_f32_le();
30175 *v = val;
30176 }
30177 for v in &mut __struct.vel_yaw {
30178 let val = buf.get_f32_le();
30179 *v = val;
30180 }
30181 for v in &mut __struct.command {
30182 let val = buf.get_u16_le();
30183 *v = val;
30184 }
30185 __struct.valid_points = buf.get_u8();
30186 Ok(__struct)
30187 }
30188 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30189 let mut __tmp = BytesMut::new(bytes);
30190 #[allow(clippy::absurd_extreme_comparisons)]
30191 #[allow(unused_comparisons)]
30192 if __tmp.remaining() < Self::ENCODED_LEN {
30193 panic!(
30194 "buffer is too small (need {} bytes, but got {})",
30195 Self::ENCODED_LEN,
30196 __tmp.remaining(),
30197 )
30198 }
30199 __tmp.put_u64_le(self.time_usec);
30200 for val in &self.pos_x {
30201 __tmp.put_f32_le(*val);
30202 }
30203 for val in &self.pos_y {
30204 __tmp.put_f32_le(*val);
30205 }
30206 for val in &self.pos_z {
30207 __tmp.put_f32_le(*val);
30208 }
30209 for val in &self.vel_x {
30210 __tmp.put_f32_le(*val);
30211 }
30212 for val in &self.vel_y {
30213 __tmp.put_f32_le(*val);
30214 }
30215 for val in &self.vel_z {
30216 __tmp.put_f32_le(*val);
30217 }
30218 for val in &self.acc_x {
30219 __tmp.put_f32_le(*val);
30220 }
30221 for val in &self.acc_y {
30222 __tmp.put_f32_le(*val);
30223 }
30224 for val in &self.acc_z {
30225 __tmp.put_f32_le(*val);
30226 }
30227 for val in &self.pos_yaw {
30228 __tmp.put_f32_le(*val);
30229 }
30230 for val in &self.vel_yaw {
30231 __tmp.put_f32_le(*val);
30232 }
30233 for val in &self.command {
30234 __tmp.put_u16_le(*val);
30235 }
30236 __tmp.put_u8(self.valid_points);
30237 if matches!(version, MavlinkVersion::V2) {
30238 let len = __tmp.len();
30239 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30240 } else {
30241 __tmp.len()
30242 }
30243 }
30244}
30245#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30246#[doc = ""]
30247#[doc = "ID: 385"]
30248#[derive(Debug, Clone, PartialEq)]
30249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30250#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30251pub struct TUNNEL_DATA {
30252 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30253 pub payload_type: MavTunnelPayloadType,
30254 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30255 pub target_system: u8,
30256 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30257 pub target_component: u8,
30258 #[doc = "Length of the data transported in payload"]
30259 pub payload_length: u8,
30260 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30261 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30262 pub payload: [u8; 128],
30263}
30264impl TUNNEL_DATA {
30265 pub const ENCODED_LEN: usize = 133usize;
30266 pub const DEFAULT: Self = Self {
30267 payload_type: MavTunnelPayloadType::DEFAULT,
30268 target_system: 0_u8,
30269 target_component: 0_u8,
30270 payload_length: 0_u8,
30271 payload: [0_u8; 128usize],
30272 };
30273 #[cfg(feature = "arbitrary")]
30274 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30275 use arbitrary::{Arbitrary, Unstructured};
30276 let mut buf = [0u8; 1024];
30277 rng.fill_bytes(&mut buf);
30278 let mut unstructured = Unstructured::new(&buf);
30279 Self::arbitrary(&mut unstructured).unwrap_or_default()
30280 }
30281}
30282impl Default for TUNNEL_DATA {
30283 fn default() -> Self {
30284 Self::DEFAULT.clone()
30285 }
30286}
30287impl MessageData for TUNNEL_DATA {
30288 type Message = MavMessage;
30289 const ID: u32 = 385u32;
30290 const NAME: &'static str = "TUNNEL";
30291 const EXTRA_CRC: u8 = 147u8;
30292 const ENCODED_LEN: usize = 133usize;
30293 fn deser(
30294 _version: MavlinkVersion,
30295 __input: &[u8],
30296 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30297 let avail_len = __input.len();
30298 let mut payload_buf = [0; Self::ENCODED_LEN];
30299 let mut buf = if avail_len < Self::ENCODED_LEN {
30300 payload_buf[0..avail_len].copy_from_slice(__input);
30301 Bytes::new(&payload_buf)
30302 } else {
30303 Bytes::new(__input)
30304 };
30305 let mut __struct = Self::default();
30306 let tmp = buf.get_u16_le();
30307 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30308 ::mavlink_core::error::ParserError::InvalidEnum {
30309 enum_type: "MavTunnelPayloadType",
30310 value: tmp as u32,
30311 },
30312 )?;
30313 __struct.target_system = buf.get_u8();
30314 __struct.target_component = buf.get_u8();
30315 __struct.payload_length = buf.get_u8();
30316 for v in &mut __struct.payload {
30317 let val = buf.get_u8();
30318 *v = val;
30319 }
30320 Ok(__struct)
30321 }
30322 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30323 let mut __tmp = BytesMut::new(bytes);
30324 #[allow(clippy::absurd_extreme_comparisons)]
30325 #[allow(unused_comparisons)]
30326 if __tmp.remaining() < Self::ENCODED_LEN {
30327 panic!(
30328 "buffer is too small (need {} bytes, but got {})",
30329 Self::ENCODED_LEN,
30330 __tmp.remaining(),
30331 )
30332 }
30333 __tmp.put_u16_le(self.payload_type as u16);
30334 __tmp.put_u8(self.target_system);
30335 __tmp.put_u8(self.target_component);
30336 __tmp.put_u8(self.payload_length);
30337 for val in &self.payload {
30338 __tmp.put_u8(*val);
30339 }
30340 if matches!(version, MavlinkVersion::V2) {
30341 let len = __tmp.len();
30342 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30343 } else {
30344 __tmp.len()
30345 }
30346 }
30347}
30348#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
30349#[doc = ""]
30350#[doc = "ID: 311"]
30351#[derive(Debug, Clone, PartialEq)]
30352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30353#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30354pub struct UAVCAN_NODE_INFO_DATA {
30355 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30356 pub time_usec: u64,
30357 #[doc = "Time since the start-up of the node."]
30358 pub uptime_sec: u32,
30359 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
30360 pub sw_vcs_commit: u32,
30361 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
30362 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30363 pub name: [u8; 80],
30364 #[doc = "Hardware major version number."]
30365 pub hw_version_major: u8,
30366 #[doc = "Hardware minor version number."]
30367 pub hw_version_minor: u8,
30368 #[doc = "Hardware unique 128-bit ID."]
30369 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30370 pub hw_unique_id: [u8; 16],
30371 #[doc = "Software major version number."]
30372 pub sw_version_major: u8,
30373 #[doc = "Software minor version number."]
30374 pub sw_version_minor: u8,
30375}
30376impl UAVCAN_NODE_INFO_DATA {
30377 pub const ENCODED_LEN: usize = 116usize;
30378 pub const DEFAULT: Self = Self {
30379 time_usec: 0_u64,
30380 uptime_sec: 0_u32,
30381 sw_vcs_commit: 0_u32,
30382 name: [0_u8; 80usize],
30383 hw_version_major: 0_u8,
30384 hw_version_minor: 0_u8,
30385 hw_unique_id: [0_u8; 16usize],
30386 sw_version_major: 0_u8,
30387 sw_version_minor: 0_u8,
30388 };
30389 #[cfg(feature = "arbitrary")]
30390 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30391 use arbitrary::{Arbitrary, Unstructured};
30392 let mut buf = [0u8; 1024];
30393 rng.fill_bytes(&mut buf);
30394 let mut unstructured = Unstructured::new(&buf);
30395 Self::arbitrary(&mut unstructured).unwrap_or_default()
30396 }
30397}
30398impl Default for UAVCAN_NODE_INFO_DATA {
30399 fn default() -> Self {
30400 Self::DEFAULT.clone()
30401 }
30402}
30403impl MessageData for UAVCAN_NODE_INFO_DATA {
30404 type Message = MavMessage;
30405 const ID: u32 = 311u32;
30406 const NAME: &'static str = "UAVCAN_NODE_INFO";
30407 const EXTRA_CRC: u8 = 95u8;
30408 const ENCODED_LEN: usize = 116usize;
30409 fn deser(
30410 _version: MavlinkVersion,
30411 __input: &[u8],
30412 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30413 let avail_len = __input.len();
30414 let mut payload_buf = [0; Self::ENCODED_LEN];
30415 let mut buf = if avail_len < Self::ENCODED_LEN {
30416 payload_buf[0..avail_len].copy_from_slice(__input);
30417 Bytes::new(&payload_buf)
30418 } else {
30419 Bytes::new(__input)
30420 };
30421 let mut __struct = Self::default();
30422 __struct.time_usec = buf.get_u64_le();
30423 __struct.uptime_sec = buf.get_u32_le();
30424 __struct.sw_vcs_commit = buf.get_u32_le();
30425 for v in &mut __struct.name {
30426 let val = buf.get_u8();
30427 *v = val;
30428 }
30429 __struct.hw_version_major = buf.get_u8();
30430 __struct.hw_version_minor = buf.get_u8();
30431 for v in &mut __struct.hw_unique_id {
30432 let val = buf.get_u8();
30433 *v = val;
30434 }
30435 __struct.sw_version_major = buf.get_u8();
30436 __struct.sw_version_minor = buf.get_u8();
30437 Ok(__struct)
30438 }
30439 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30440 let mut __tmp = BytesMut::new(bytes);
30441 #[allow(clippy::absurd_extreme_comparisons)]
30442 #[allow(unused_comparisons)]
30443 if __tmp.remaining() < Self::ENCODED_LEN {
30444 panic!(
30445 "buffer is too small (need {} bytes, but got {})",
30446 Self::ENCODED_LEN,
30447 __tmp.remaining(),
30448 )
30449 }
30450 __tmp.put_u64_le(self.time_usec);
30451 __tmp.put_u32_le(self.uptime_sec);
30452 __tmp.put_u32_le(self.sw_vcs_commit);
30453 for val in &self.name {
30454 __tmp.put_u8(*val);
30455 }
30456 __tmp.put_u8(self.hw_version_major);
30457 __tmp.put_u8(self.hw_version_minor);
30458 for val in &self.hw_unique_id {
30459 __tmp.put_u8(*val);
30460 }
30461 __tmp.put_u8(self.sw_version_major);
30462 __tmp.put_u8(self.sw_version_minor);
30463 if matches!(version, MavlinkVersion::V2) {
30464 let len = __tmp.len();
30465 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30466 } else {
30467 __tmp.len()
30468 }
30469 }
30470}
30471#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30472#[doc = ""]
30473#[doc = "ID: 310"]
30474#[derive(Debug, Clone, PartialEq)]
30475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30477pub struct UAVCAN_NODE_STATUS_DATA {
30478 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30479 pub time_usec: u64,
30480 #[doc = "Time since the start-up of the node."]
30481 pub uptime_sec: u32,
30482 #[doc = "Vendor-specific status information."]
30483 pub vendor_specific_status_code: u16,
30484 #[doc = "Generalized node health status."]
30485 pub health: UavcanNodeHealth,
30486 #[doc = "Generalized operating mode."]
30487 pub mode: UavcanNodeMode,
30488 #[doc = "Not used currently."]
30489 pub sub_mode: u8,
30490}
30491impl UAVCAN_NODE_STATUS_DATA {
30492 pub const ENCODED_LEN: usize = 17usize;
30493 pub const DEFAULT: Self = Self {
30494 time_usec: 0_u64,
30495 uptime_sec: 0_u32,
30496 vendor_specific_status_code: 0_u16,
30497 health: UavcanNodeHealth::DEFAULT,
30498 mode: UavcanNodeMode::DEFAULT,
30499 sub_mode: 0_u8,
30500 };
30501 #[cfg(feature = "arbitrary")]
30502 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30503 use arbitrary::{Arbitrary, Unstructured};
30504 let mut buf = [0u8; 1024];
30505 rng.fill_bytes(&mut buf);
30506 let mut unstructured = Unstructured::new(&buf);
30507 Self::arbitrary(&mut unstructured).unwrap_or_default()
30508 }
30509}
30510impl Default for UAVCAN_NODE_STATUS_DATA {
30511 fn default() -> Self {
30512 Self::DEFAULT.clone()
30513 }
30514}
30515impl MessageData for UAVCAN_NODE_STATUS_DATA {
30516 type Message = MavMessage;
30517 const ID: u32 = 310u32;
30518 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30519 const EXTRA_CRC: u8 = 28u8;
30520 const ENCODED_LEN: usize = 17usize;
30521 fn deser(
30522 _version: MavlinkVersion,
30523 __input: &[u8],
30524 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30525 let avail_len = __input.len();
30526 let mut payload_buf = [0; Self::ENCODED_LEN];
30527 let mut buf = if avail_len < Self::ENCODED_LEN {
30528 payload_buf[0..avail_len].copy_from_slice(__input);
30529 Bytes::new(&payload_buf)
30530 } else {
30531 Bytes::new(__input)
30532 };
30533 let mut __struct = Self::default();
30534 __struct.time_usec = buf.get_u64_le();
30535 __struct.uptime_sec = buf.get_u32_le();
30536 __struct.vendor_specific_status_code = buf.get_u16_le();
30537 let tmp = buf.get_u8();
30538 __struct.health =
30539 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30540 enum_type: "UavcanNodeHealth",
30541 value: tmp as u32,
30542 })?;
30543 let tmp = buf.get_u8();
30544 __struct.mode =
30545 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30546 enum_type: "UavcanNodeMode",
30547 value: tmp as u32,
30548 })?;
30549 __struct.sub_mode = buf.get_u8();
30550 Ok(__struct)
30551 }
30552 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30553 let mut __tmp = BytesMut::new(bytes);
30554 #[allow(clippy::absurd_extreme_comparisons)]
30555 #[allow(unused_comparisons)]
30556 if __tmp.remaining() < Self::ENCODED_LEN {
30557 panic!(
30558 "buffer is too small (need {} bytes, but got {})",
30559 Self::ENCODED_LEN,
30560 __tmp.remaining(),
30561 )
30562 }
30563 __tmp.put_u64_le(self.time_usec);
30564 __tmp.put_u32_le(self.uptime_sec);
30565 __tmp.put_u16_le(self.vendor_specific_status_code);
30566 __tmp.put_u8(self.health as u8);
30567 __tmp.put_u8(self.mode as u8);
30568 __tmp.put_u8(self.sub_mode);
30569 if matches!(version, MavlinkVersion::V2) {
30570 let len = __tmp.len();
30571 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30572 } else {
30573 __tmp.len()
30574 }
30575 }
30576}
30577#[doc = "The global position resulting from GPS and sensor fusion."]
30578#[doc = ""]
30579#[doc = "ID: 340"]
30580#[derive(Debug, Clone, PartialEq)]
30581#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30583pub struct UTM_GLOBAL_POSITION_DATA {
30584 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
30585 pub time: u64,
30586 #[doc = "Latitude (WGS84)"]
30587 pub lat: i32,
30588 #[doc = "Longitude (WGS84)"]
30589 pub lon: i32,
30590 #[doc = "Altitude (WGS84)"]
30591 pub alt: i32,
30592 #[doc = "Altitude above ground"]
30593 pub relative_alt: i32,
30594 #[doc = "Next waypoint, latitude (WGS84)"]
30595 pub next_lat: i32,
30596 #[doc = "Next waypoint, longitude (WGS84)"]
30597 pub next_lon: i32,
30598 #[doc = "Next waypoint, altitude (WGS84)"]
30599 pub next_alt: i32,
30600 #[doc = "Ground X speed (latitude, positive north)"]
30601 pub vx: i16,
30602 #[doc = "Ground Y speed (longitude, positive east)"]
30603 pub vy: i16,
30604 #[doc = "Ground Z speed (altitude, positive down)"]
30605 pub vz: i16,
30606 #[doc = "Horizontal position uncertainty (standard deviation)"]
30607 pub h_acc: u16,
30608 #[doc = "Altitude uncertainty (standard deviation)"]
30609 pub v_acc: u16,
30610 #[doc = "Speed uncertainty (standard deviation)"]
30611 pub vel_acc: u16,
30612 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
30613 pub update_rate: u16,
30614 #[doc = "Unique UAS ID."]
30615 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30616 pub uas_id: [u8; 18],
30617 #[doc = "Flight state"]
30618 pub flight_state: UtmFlightState,
30619 #[doc = "Bitwise OR combination of the data available flags."]
30620 pub flags: UtmDataAvailFlags,
30621}
30622impl UTM_GLOBAL_POSITION_DATA {
30623 pub const ENCODED_LEN: usize = 70usize;
30624 pub const DEFAULT: Self = Self {
30625 time: 0_u64,
30626 lat: 0_i32,
30627 lon: 0_i32,
30628 alt: 0_i32,
30629 relative_alt: 0_i32,
30630 next_lat: 0_i32,
30631 next_lon: 0_i32,
30632 next_alt: 0_i32,
30633 vx: 0_i16,
30634 vy: 0_i16,
30635 vz: 0_i16,
30636 h_acc: 0_u16,
30637 v_acc: 0_u16,
30638 vel_acc: 0_u16,
30639 update_rate: 0_u16,
30640 uas_id: [0_u8; 18usize],
30641 flight_state: UtmFlightState::DEFAULT,
30642 flags: UtmDataAvailFlags::DEFAULT,
30643 };
30644 #[cfg(feature = "arbitrary")]
30645 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30646 use arbitrary::{Arbitrary, Unstructured};
30647 let mut buf = [0u8; 1024];
30648 rng.fill_bytes(&mut buf);
30649 let mut unstructured = Unstructured::new(&buf);
30650 Self::arbitrary(&mut unstructured).unwrap_or_default()
30651 }
30652}
30653impl Default for UTM_GLOBAL_POSITION_DATA {
30654 fn default() -> Self {
30655 Self::DEFAULT.clone()
30656 }
30657}
30658impl MessageData for UTM_GLOBAL_POSITION_DATA {
30659 type Message = MavMessage;
30660 const ID: u32 = 340u32;
30661 const NAME: &'static str = "UTM_GLOBAL_POSITION";
30662 const EXTRA_CRC: u8 = 99u8;
30663 const ENCODED_LEN: usize = 70usize;
30664 fn deser(
30665 _version: MavlinkVersion,
30666 __input: &[u8],
30667 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30668 let avail_len = __input.len();
30669 let mut payload_buf = [0; Self::ENCODED_LEN];
30670 let mut buf = if avail_len < Self::ENCODED_LEN {
30671 payload_buf[0..avail_len].copy_from_slice(__input);
30672 Bytes::new(&payload_buf)
30673 } else {
30674 Bytes::new(__input)
30675 };
30676 let mut __struct = Self::default();
30677 __struct.time = buf.get_u64_le();
30678 __struct.lat = buf.get_i32_le();
30679 __struct.lon = buf.get_i32_le();
30680 __struct.alt = buf.get_i32_le();
30681 __struct.relative_alt = buf.get_i32_le();
30682 __struct.next_lat = buf.get_i32_le();
30683 __struct.next_lon = buf.get_i32_le();
30684 __struct.next_alt = buf.get_i32_le();
30685 __struct.vx = buf.get_i16_le();
30686 __struct.vy = buf.get_i16_le();
30687 __struct.vz = buf.get_i16_le();
30688 __struct.h_acc = buf.get_u16_le();
30689 __struct.v_acc = buf.get_u16_le();
30690 __struct.vel_acc = buf.get_u16_le();
30691 __struct.update_rate = buf.get_u16_le();
30692 for v in &mut __struct.uas_id {
30693 let val = buf.get_u8();
30694 *v = val;
30695 }
30696 let tmp = buf.get_u8();
30697 __struct.flight_state =
30698 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30699 enum_type: "UtmFlightState",
30700 value: tmp as u32,
30701 })?;
30702 let tmp = buf.get_u8();
30703 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
30704 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30705 flag_type: "UtmDataAvailFlags",
30706 value: tmp as u32,
30707 })?;
30708 Ok(__struct)
30709 }
30710 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30711 let mut __tmp = BytesMut::new(bytes);
30712 #[allow(clippy::absurd_extreme_comparisons)]
30713 #[allow(unused_comparisons)]
30714 if __tmp.remaining() < Self::ENCODED_LEN {
30715 panic!(
30716 "buffer is too small (need {} bytes, but got {})",
30717 Self::ENCODED_LEN,
30718 __tmp.remaining(),
30719 )
30720 }
30721 __tmp.put_u64_le(self.time);
30722 __tmp.put_i32_le(self.lat);
30723 __tmp.put_i32_le(self.lon);
30724 __tmp.put_i32_le(self.alt);
30725 __tmp.put_i32_le(self.relative_alt);
30726 __tmp.put_i32_le(self.next_lat);
30727 __tmp.put_i32_le(self.next_lon);
30728 __tmp.put_i32_le(self.next_alt);
30729 __tmp.put_i16_le(self.vx);
30730 __tmp.put_i16_le(self.vy);
30731 __tmp.put_i16_le(self.vz);
30732 __tmp.put_u16_le(self.h_acc);
30733 __tmp.put_u16_le(self.v_acc);
30734 __tmp.put_u16_le(self.vel_acc);
30735 __tmp.put_u16_le(self.update_rate);
30736 for val in &self.uas_id {
30737 __tmp.put_u8(*val);
30738 }
30739 __tmp.put_u8(self.flight_state as u8);
30740 __tmp.put_u8(self.flags.bits());
30741 if matches!(version, MavlinkVersion::V2) {
30742 let len = __tmp.len();
30743 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30744 } else {
30745 __tmp.len()
30746 }
30747 }
30748}
30749#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
30750#[doc = ""]
30751#[doc = "ID: 248"]
30752#[derive(Debug, Clone, PartialEq)]
30753#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30755pub struct V2_EXTENSION_DATA {
30756 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30757 pub message_type: u16,
30758 #[doc = "Network ID (0 for broadcast)"]
30759 pub target_network: u8,
30760 #[doc = "System ID (0 for broadcast)"]
30761 pub target_system: u8,
30762 #[doc = "Component ID (0 for broadcast)"]
30763 pub target_component: u8,
30764 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
30765 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30766 pub payload: [u8; 249],
30767}
30768impl V2_EXTENSION_DATA {
30769 pub const ENCODED_LEN: usize = 254usize;
30770 pub const DEFAULT: Self = Self {
30771 message_type: 0_u16,
30772 target_network: 0_u8,
30773 target_system: 0_u8,
30774 target_component: 0_u8,
30775 payload: [0_u8; 249usize],
30776 };
30777 #[cfg(feature = "arbitrary")]
30778 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30779 use arbitrary::{Arbitrary, Unstructured};
30780 let mut buf = [0u8; 1024];
30781 rng.fill_bytes(&mut buf);
30782 let mut unstructured = Unstructured::new(&buf);
30783 Self::arbitrary(&mut unstructured).unwrap_or_default()
30784 }
30785}
30786impl Default for V2_EXTENSION_DATA {
30787 fn default() -> Self {
30788 Self::DEFAULT.clone()
30789 }
30790}
30791impl MessageData for V2_EXTENSION_DATA {
30792 type Message = MavMessage;
30793 const ID: u32 = 248u32;
30794 const NAME: &'static str = "V2_EXTENSION";
30795 const EXTRA_CRC: u8 = 8u8;
30796 const ENCODED_LEN: usize = 254usize;
30797 fn deser(
30798 _version: MavlinkVersion,
30799 __input: &[u8],
30800 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30801 let avail_len = __input.len();
30802 let mut payload_buf = [0; Self::ENCODED_LEN];
30803 let mut buf = if avail_len < Self::ENCODED_LEN {
30804 payload_buf[0..avail_len].copy_from_slice(__input);
30805 Bytes::new(&payload_buf)
30806 } else {
30807 Bytes::new(__input)
30808 };
30809 let mut __struct = Self::default();
30810 __struct.message_type = buf.get_u16_le();
30811 __struct.target_network = buf.get_u8();
30812 __struct.target_system = buf.get_u8();
30813 __struct.target_component = buf.get_u8();
30814 for v in &mut __struct.payload {
30815 let val = buf.get_u8();
30816 *v = val;
30817 }
30818 Ok(__struct)
30819 }
30820 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30821 let mut __tmp = BytesMut::new(bytes);
30822 #[allow(clippy::absurd_extreme_comparisons)]
30823 #[allow(unused_comparisons)]
30824 if __tmp.remaining() < Self::ENCODED_LEN {
30825 panic!(
30826 "buffer is too small (need {} bytes, but got {})",
30827 Self::ENCODED_LEN,
30828 __tmp.remaining(),
30829 )
30830 }
30831 __tmp.put_u16_le(self.message_type);
30832 __tmp.put_u8(self.target_network);
30833 __tmp.put_u8(self.target_system);
30834 __tmp.put_u8(self.target_component);
30835 for val in &self.payload {
30836 __tmp.put_u8(*val);
30837 }
30838 if matches!(version, MavlinkVersion::V2) {
30839 let len = __tmp.len();
30840 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30841 } else {
30842 __tmp.len()
30843 }
30844 }
30845}
30846#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
30847#[doc = ""]
30848#[doc = "ID: 74"]
30849#[derive(Debug, Clone, PartialEq)]
30850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30852pub struct VFR_HUD_DATA {
30853 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
30854 pub airspeed: f32,
30855 #[doc = "Current ground speed."]
30856 pub groundspeed: f32,
30857 #[doc = "Current altitude (MSL)."]
30858 pub alt: f32,
30859 #[doc = "Current climb rate."]
30860 pub climb: f32,
30861 #[doc = "Current heading in compass units (0-360, 0=north)."]
30862 pub heading: i16,
30863 #[doc = "Current throttle setting (0 to 100)."]
30864 pub throttle: u16,
30865}
30866impl VFR_HUD_DATA {
30867 pub const ENCODED_LEN: usize = 20usize;
30868 pub const DEFAULT: Self = Self {
30869 airspeed: 0.0_f32,
30870 groundspeed: 0.0_f32,
30871 alt: 0.0_f32,
30872 climb: 0.0_f32,
30873 heading: 0_i16,
30874 throttle: 0_u16,
30875 };
30876 #[cfg(feature = "arbitrary")]
30877 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30878 use arbitrary::{Arbitrary, Unstructured};
30879 let mut buf = [0u8; 1024];
30880 rng.fill_bytes(&mut buf);
30881 let mut unstructured = Unstructured::new(&buf);
30882 Self::arbitrary(&mut unstructured).unwrap_or_default()
30883 }
30884}
30885impl Default for VFR_HUD_DATA {
30886 fn default() -> Self {
30887 Self::DEFAULT.clone()
30888 }
30889}
30890impl MessageData for VFR_HUD_DATA {
30891 type Message = MavMessage;
30892 const ID: u32 = 74u32;
30893 const NAME: &'static str = "VFR_HUD";
30894 const EXTRA_CRC: u8 = 20u8;
30895 const ENCODED_LEN: usize = 20usize;
30896 fn deser(
30897 _version: MavlinkVersion,
30898 __input: &[u8],
30899 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30900 let avail_len = __input.len();
30901 let mut payload_buf = [0; Self::ENCODED_LEN];
30902 let mut buf = if avail_len < Self::ENCODED_LEN {
30903 payload_buf[0..avail_len].copy_from_slice(__input);
30904 Bytes::new(&payload_buf)
30905 } else {
30906 Bytes::new(__input)
30907 };
30908 let mut __struct = Self::default();
30909 __struct.airspeed = buf.get_f32_le();
30910 __struct.groundspeed = buf.get_f32_le();
30911 __struct.alt = buf.get_f32_le();
30912 __struct.climb = buf.get_f32_le();
30913 __struct.heading = buf.get_i16_le();
30914 __struct.throttle = buf.get_u16_le();
30915 Ok(__struct)
30916 }
30917 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30918 let mut __tmp = BytesMut::new(bytes);
30919 #[allow(clippy::absurd_extreme_comparisons)]
30920 #[allow(unused_comparisons)]
30921 if __tmp.remaining() < Self::ENCODED_LEN {
30922 panic!(
30923 "buffer is too small (need {} bytes, but got {})",
30924 Self::ENCODED_LEN,
30925 __tmp.remaining(),
30926 )
30927 }
30928 __tmp.put_f32_le(self.airspeed);
30929 __tmp.put_f32_le(self.groundspeed);
30930 __tmp.put_f32_le(self.alt);
30931 __tmp.put_f32_le(self.climb);
30932 __tmp.put_i16_le(self.heading);
30933 __tmp.put_u16_le(self.throttle);
30934 if matches!(version, MavlinkVersion::V2) {
30935 let len = __tmp.len();
30936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30937 } else {
30938 __tmp.len()
30939 }
30940 }
30941}
30942#[doc = "Vibration levels and accelerometer clipping."]
30943#[doc = ""]
30944#[doc = "ID: 241"]
30945#[derive(Debug, Clone, PartialEq)]
30946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30948pub struct VIBRATION_DATA {
30949 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30950 pub time_usec: u64,
30951 #[doc = "Vibration levels on X-axis"]
30952 pub vibration_x: f32,
30953 #[doc = "Vibration levels on Y-axis"]
30954 pub vibration_y: f32,
30955 #[doc = "Vibration levels on Z-axis"]
30956 pub vibration_z: f32,
30957 #[doc = "first accelerometer clipping count"]
30958 pub clipping_0: u32,
30959 #[doc = "second accelerometer clipping count"]
30960 pub clipping_1: u32,
30961 #[doc = "third accelerometer clipping count"]
30962 pub clipping_2: u32,
30963}
30964impl VIBRATION_DATA {
30965 pub const ENCODED_LEN: usize = 32usize;
30966 pub const DEFAULT: Self = Self {
30967 time_usec: 0_u64,
30968 vibration_x: 0.0_f32,
30969 vibration_y: 0.0_f32,
30970 vibration_z: 0.0_f32,
30971 clipping_0: 0_u32,
30972 clipping_1: 0_u32,
30973 clipping_2: 0_u32,
30974 };
30975 #[cfg(feature = "arbitrary")]
30976 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30977 use arbitrary::{Arbitrary, Unstructured};
30978 let mut buf = [0u8; 1024];
30979 rng.fill_bytes(&mut buf);
30980 let mut unstructured = Unstructured::new(&buf);
30981 Self::arbitrary(&mut unstructured).unwrap_or_default()
30982 }
30983}
30984impl Default for VIBRATION_DATA {
30985 fn default() -> Self {
30986 Self::DEFAULT.clone()
30987 }
30988}
30989impl MessageData for VIBRATION_DATA {
30990 type Message = MavMessage;
30991 const ID: u32 = 241u32;
30992 const NAME: &'static str = "VIBRATION";
30993 const EXTRA_CRC: u8 = 90u8;
30994 const ENCODED_LEN: usize = 32usize;
30995 fn deser(
30996 _version: MavlinkVersion,
30997 __input: &[u8],
30998 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30999 let avail_len = __input.len();
31000 let mut payload_buf = [0; Self::ENCODED_LEN];
31001 let mut buf = if avail_len < Self::ENCODED_LEN {
31002 payload_buf[0..avail_len].copy_from_slice(__input);
31003 Bytes::new(&payload_buf)
31004 } else {
31005 Bytes::new(__input)
31006 };
31007 let mut __struct = Self::default();
31008 __struct.time_usec = buf.get_u64_le();
31009 __struct.vibration_x = buf.get_f32_le();
31010 __struct.vibration_y = buf.get_f32_le();
31011 __struct.vibration_z = buf.get_f32_le();
31012 __struct.clipping_0 = buf.get_u32_le();
31013 __struct.clipping_1 = buf.get_u32_le();
31014 __struct.clipping_2 = buf.get_u32_le();
31015 Ok(__struct)
31016 }
31017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31018 let mut __tmp = BytesMut::new(bytes);
31019 #[allow(clippy::absurd_extreme_comparisons)]
31020 #[allow(unused_comparisons)]
31021 if __tmp.remaining() < Self::ENCODED_LEN {
31022 panic!(
31023 "buffer is too small (need {} bytes, but got {})",
31024 Self::ENCODED_LEN,
31025 __tmp.remaining(),
31026 )
31027 }
31028 __tmp.put_u64_le(self.time_usec);
31029 __tmp.put_f32_le(self.vibration_x);
31030 __tmp.put_f32_le(self.vibration_y);
31031 __tmp.put_f32_le(self.vibration_z);
31032 __tmp.put_u32_le(self.clipping_0);
31033 __tmp.put_u32_le(self.clipping_1);
31034 __tmp.put_u32_le(self.clipping_2);
31035 if matches!(version, MavlinkVersion::V2) {
31036 let len = __tmp.len();
31037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31038 } else {
31039 __tmp.len()
31040 }
31041 }
31042}
31043#[doc = "Global position estimate from a Vicon motion system source."]
31044#[doc = ""]
31045#[doc = "ID: 104"]
31046#[derive(Debug, Clone, PartialEq)]
31047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31049pub struct VICON_POSITION_ESTIMATE_DATA {
31050 #[doc = "Timestamp (UNIX time or time since system boot)"]
31051 pub usec: u64,
31052 #[doc = "Global X position"]
31053 pub x: f32,
31054 #[doc = "Global Y position"]
31055 pub y: f32,
31056 #[doc = "Global Z position"]
31057 pub z: f32,
31058 #[doc = "Roll angle"]
31059 pub roll: f32,
31060 #[doc = "Pitch angle"]
31061 pub pitch: f32,
31062 #[doc = "Yaw angle"]
31063 pub yaw: f32,
31064 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31065 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31066 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31067 pub covariance: [f32; 21],
31068}
31069impl VICON_POSITION_ESTIMATE_DATA {
31070 pub const ENCODED_LEN: usize = 116usize;
31071 pub const DEFAULT: Self = Self {
31072 usec: 0_u64,
31073 x: 0.0_f32,
31074 y: 0.0_f32,
31075 z: 0.0_f32,
31076 roll: 0.0_f32,
31077 pitch: 0.0_f32,
31078 yaw: 0.0_f32,
31079 covariance: [0.0_f32; 21usize],
31080 };
31081 #[cfg(feature = "arbitrary")]
31082 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31083 use arbitrary::{Arbitrary, Unstructured};
31084 let mut buf = [0u8; 1024];
31085 rng.fill_bytes(&mut buf);
31086 let mut unstructured = Unstructured::new(&buf);
31087 Self::arbitrary(&mut unstructured).unwrap_or_default()
31088 }
31089}
31090impl Default for VICON_POSITION_ESTIMATE_DATA {
31091 fn default() -> Self {
31092 Self::DEFAULT.clone()
31093 }
31094}
31095impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31096 type Message = MavMessage;
31097 const ID: u32 = 104u32;
31098 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31099 const EXTRA_CRC: u8 = 56u8;
31100 const ENCODED_LEN: usize = 116usize;
31101 fn deser(
31102 _version: MavlinkVersion,
31103 __input: &[u8],
31104 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31105 let avail_len = __input.len();
31106 let mut payload_buf = [0; Self::ENCODED_LEN];
31107 let mut buf = if avail_len < Self::ENCODED_LEN {
31108 payload_buf[0..avail_len].copy_from_slice(__input);
31109 Bytes::new(&payload_buf)
31110 } else {
31111 Bytes::new(__input)
31112 };
31113 let mut __struct = Self::default();
31114 __struct.usec = buf.get_u64_le();
31115 __struct.x = buf.get_f32_le();
31116 __struct.y = buf.get_f32_le();
31117 __struct.z = buf.get_f32_le();
31118 __struct.roll = buf.get_f32_le();
31119 __struct.pitch = buf.get_f32_le();
31120 __struct.yaw = buf.get_f32_le();
31121 for v in &mut __struct.covariance {
31122 let val = buf.get_f32_le();
31123 *v = val;
31124 }
31125 Ok(__struct)
31126 }
31127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31128 let mut __tmp = BytesMut::new(bytes);
31129 #[allow(clippy::absurd_extreme_comparisons)]
31130 #[allow(unused_comparisons)]
31131 if __tmp.remaining() < Self::ENCODED_LEN {
31132 panic!(
31133 "buffer is too small (need {} bytes, but got {})",
31134 Self::ENCODED_LEN,
31135 __tmp.remaining(),
31136 )
31137 }
31138 __tmp.put_u64_le(self.usec);
31139 __tmp.put_f32_le(self.x);
31140 __tmp.put_f32_le(self.y);
31141 __tmp.put_f32_le(self.z);
31142 __tmp.put_f32_le(self.roll);
31143 __tmp.put_f32_le(self.pitch);
31144 __tmp.put_f32_le(self.yaw);
31145 if matches!(version, MavlinkVersion::V2) {
31146 for val in &self.covariance {
31147 __tmp.put_f32_le(*val);
31148 }
31149 let len = __tmp.len();
31150 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31151 } else {
31152 __tmp.len()
31153 }
31154 }
31155}
31156#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31157#[doc = ""]
31158#[doc = "ID: 269"]
31159#[derive(Debug, Clone, PartialEq)]
31160#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31161#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31162pub struct VIDEO_STREAM_INFORMATION_DATA {
31163 #[doc = "Frame rate."]
31164 pub framerate: f32,
31165 #[doc = "Bit rate."]
31166 pub bitrate: u32,
31167 #[doc = "Bitmap of stream status flags."]
31168 pub flags: VideoStreamStatusFlags,
31169 #[doc = "Horizontal resolution."]
31170 pub resolution_h: u16,
31171 #[doc = "Vertical resolution."]
31172 pub resolution_v: u16,
31173 #[doc = "Video image rotation clockwise."]
31174 pub rotation: u16,
31175 #[doc = "Horizontal Field of view."]
31176 pub hfov: u16,
31177 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31178 pub stream_id: u8,
31179 #[doc = "Number of streams available."]
31180 pub count: u8,
31181 #[doc = "Type of stream."]
31182 pub mavtype: VideoStreamType,
31183 #[doc = "Stream name."]
31184 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31185 pub name: [u8; 32],
31186 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31187 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31188 pub uri: [u8; 160],
31189 #[doc = "Encoding of stream."]
31190 #[cfg_attr(feature = "serde", serde(default))]
31191 pub encoding: VideoStreamEncoding,
31192 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31193 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31194 pub camera_device_id: u8,
31195}
31196impl VIDEO_STREAM_INFORMATION_DATA {
31197 pub const ENCODED_LEN: usize = 215usize;
31198 pub const DEFAULT: Self = Self {
31199 framerate: 0.0_f32,
31200 bitrate: 0_u32,
31201 flags: VideoStreamStatusFlags::DEFAULT,
31202 resolution_h: 0_u16,
31203 resolution_v: 0_u16,
31204 rotation: 0_u16,
31205 hfov: 0_u16,
31206 stream_id: 0_u8,
31207 count: 0_u8,
31208 mavtype: VideoStreamType::DEFAULT,
31209 name: [0_u8; 32usize],
31210 uri: [0_u8; 160usize],
31211 encoding: VideoStreamEncoding::DEFAULT,
31212 camera_device_id: 0_u8,
31213 };
31214 #[cfg(feature = "arbitrary")]
31215 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31216 use arbitrary::{Arbitrary, Unstructured};
31217 let mut buf = [0u8; 1024];
31218 rng.fill_bytes(&mut buf);
31219 let mut unstructured = Unstructured::new(&buf);
31220 Self::arbitrary(&mut unstructured).unwrap_or_default()
31221 }
31222}
31223impl Default for VIDEO_STREAM_INFORMATION_DATA {
31224 fn default() -> Self {
31225 Self::DEFAULT.clone()
31226 }
31227}
31228impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31229 type Message = MavMessage;
31230 const ID: u32 = 269u32;
31231 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31232 const EXTRA_CRC: u8 = 109u8;
31233 const ENCODED_LEN: usize = 215usize;
31234 fn deser(
31235 _version: MavlinkVersion,
31236 __input: &[u8],
31237 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31238 let avail_len = __input.len();
31239 let mut payload_buf = [0; Self::ENCODED_LEN];
31240 let mut buf = if avail_len < Self::ENCODED_LEN {
31241 payload_buf[0..avail_len].copy_from_slice(__input);
31242 Bytes::new(&payload_buf)
31243 } else {
31244 Bytes::new(__input)
31245 };
31246 let mut __struct = Self::default();
31247 __struct.framerate = buf.get_f32_le();
31248 __struct.bitrate = buf.get_u32_le();
31249 let tmp = buf.get_u16_le();
31250 __struct.flags = VideoStreamStatusFlags::from_bits(
31251 tmp & VideoStreamStatusFlags::all().bits(),
31252 )
31253 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31254 flag_type: "VideoStreamStatusFlags",
31255 value: tmp as u32,
31256 })?;
31257 __struct.resolution_h = buf.get_u16_le();
31258 __struct.resolution_v = buf.get_u16_le();
31259 __struct.rotation = buf.get_u16_le();
31260 __struct.hfov = buf.get_u16_le();
31261 __struct.stream_id = buf.get_u8();
31262 __struct.count = buf.get_u8();
31263 let tmp = buf.get_u8();
31264 __struct.mavtype =
31265 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31266 enum_type: "VideoStreamType",
31267 value: tmp as u32,
31268 })?;
31269 for v in &mut __struct.name {
31270 let val = buf.get_u8();
31271 *v = val;
31272 }
31273 for v in &mut __struct.uri {
31274 let val = buf.get_u8();
31275 *v = val;
31276 }
31277 let tmp = buf.get_u8();
31278 __struct.encoding =
31279 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31280 enum_type: "VideoStreamEncoding",
31281 value: tmp as u32,
31282 })?;
31283 __struct.camera_device_id = buf.get_u8();
31284 Ok(__struct)
31285 }
31286 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31287 let mut __tmp = BytesMut::new(bytes);
31288 #[allow(clippy::absurd_extreme_comparisons)]
31289 #[allow(unused_comparisons)]
31290 if __tmp.remaining() < Self::ENCODED_LEN {
31291 panic!(
31292 "buffer is too small (need {} bytes, but got {})",
31293 Self::ENCODED_LEN,
31294 __tmp.remaining(),
31295 )
31296 }
31297 __tmp.put_f32_le(self.framerate);
31298 __tmp.put_u32_le(self.bitrate);
31299 __tmp.put_u16_le(self.flags.bits());
31300 __tmp.put_u16_le(self.resolution_h);
31301 __tmp.put_u16_le(self.resolution_v);
31302 __tmp.put_u16_le(self.rotation);
31303 __tmp.put_u16_le(self.hfov);
31304 __tmp.put_u8(self.stream_id);
31305 __tmp.put_u8(self.count);
31306 __tmp.put_u8(self.mavtype as u8);
31307 for val in &self.name {
31308 __tmp.put_u8(*val);
31309 }
31310 for val in &self.uri {
31311 __tmp.put_u8(*val);
31312 }
31313 if matches!(version, MavlinkVersion::V2) {
31314 __tmp.put_u8(self.encoding as u8);
31315 __tmp.put_u8(self.camera_device_id);
31316 let len = __tmp.len();
31317 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31318 } else {
31319 __tmp.len()
31320 }
31321 }
31322}
31323#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
31324#[doc = ""]
31325#[doc = "ID: 270"]
31326#[derive(Debug, Clone, PartialEq)]
31327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31329pub struct VIDEO_STREAM_STATUS_DATA {
31330 #[doc = "Frame rate"]
31331 pub framerate: f32,
31332 #[doc = "Bit rate"]
31333 pub bitrate: u32,
31334 #[doc = "Bitmap of stream status flags"]
31335 pub flags: VideoStreamStatusFlags,
31336 #[doc = "Horizontal resolution"]
31337 pub resolution_h: u16,
31338 #[doc = "Vertical resolution"]
31339 pub resolution_v: u16,
31340 #[doc = "Video image rotation clockwise"]
31341 pub rotation: u16,
31342 #[doc = "Horizontal Field of view"]
31343 pub hfov: u16,
31344 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31345 pub stream_id: u8,
31346 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31347 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31348 pub camera_device_id: u8,
31349}
31350impl VIDEO_STREAM_STATUS_DATA {
31351 pub const ENCODED_LEN: usize = 20usize;
31352 pub const DEFAULT: Self = Self {
31353 framerate: 0.0_f32,
31354 bitrate: 0_u32,
31355 flags: VideoStreamStatusFlags::DEFAULT,
31356 resolution_h: 0_u16,
31357 resolution_v: 0_u16,
31358 rotation: 0_u16,
31359 hfov: 0_u16,
31360 stream_id: 0_u8,
31361 camera_device_id: 0_u8,
31362 };
31363 #[cfg(feature = "arbitrary")]
31364 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31365 use arbitrary::{Arbitrary, Unstructured};
31366 let mut buf = [0u8; 1024];
31367 rng.fill_bytes(&mut buf);
31368 let mut unstructured = Unstructured::new(&buf);
31369 Self::arbitrary(&mut unstructured).unwrap_or_default()
31370 }
31371}
31372impl Default for VIDEO_STREAM_STATUS_DATA {
31373 fn default() -> Self {
31374 Self::DEFAULT.clone()
31375 }
31376}
31377impl MessageData for VIDEO_STREAM_STATUS_DATA {
31378 type Message = MavMessage;
31379 const ID: u32 = 270u32;
31380 const NAME: &'static str = "VIDEO_STREAM_STATUS";
31381 const EXTRA_CRC: u8 = 59u8;
31382 const ENCODED_LEN: usize = 20usize;
31383 fn deser(
31384 _version: MavlinkVersion,
31385 __input: &[u8],
31386 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31387 let avail_len = __input.len();
31388 let mut payload_buf = [0; Self::ENCODED_LEN];
31389 let mut buf = if avail_len < Self::ENCODED_LEN {
31390 payload_buf[0..avail_len].copy_from_slice(__input);
31391 Bytes::new(&payload_buf)
31392 } else {
31393 Bytes::new(__input)
31394 };
31395 let mut __struct = Self::default();
31396 __struct.framerate = buf.get_f32_le();
31397 __struct.bitrate = buf.get_u32_le();
31398 let tmp = buf.get_u16_le();
31399 __struct.flags = VideoStreamStatusFlags::from_bits(
31400 tmp & VideoStreamStatusFlags::all().bits(),
31401 )
31402 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31403 flag_type: "VideoStreamStatusFlags",
31404 value: tmp as u32,
31405 })?;
31406 __struct.resolution_h = buf.get_u16_le();
31407 __struct.resolution_v = buf.get_u16_le();
31408 __struct.rotation = buf.get_u16_le();
31409 __struct.hfov = buf.get_u16_le();
31410 __struct.stream_id = buf.get_u8();
31411 __struct.camera_device_id = buf.get_u8();
31412 Ok(__struct)
31413 }
31414 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31415 let mut __tmp = BytesMut::new(bytes);
31416 #[allow(clippy::absurd_extreme_comparisons)]
31417 #[allow(unused_comparisons)]
31418 if __tmp.remaining() < Self::ENCODED_LEN {
31419 panic!(
31420 "buffer is too small (need {} bytes, but got {})",
31421 Self::ENCODED_LEN,
31422 __tmp.remaining(),
31423 )
31424 }
31425 __tmp.put_f32_le(self.framerate);
31426 __tmp.put_u32_le(self.bitrate);
31427 __tmp.put_u16_le(self.flags.bits());
31428 __tmp.put_u16_le(self.resolution_h);
31429 __tmp.put_u16_le(self.resolution_v);
31430 __tmp.put_u16_le(self.rotation);
31431 __tmp.put_u16_le(self.hfov);
31432 __tmp.put_u8(self.stream_id);
31433 if matches!(version, MavlinkVersion::V2) {
31434 __tmp.put_u8(self.camera_device_id);
31435 let len = __tmp.len();
31436 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31437 } else {
31438 __tmp.len()
31439 }
31440 }
31441}
31442#[doc = "Local position/attitude estimate from a vision source."]
31443#[doc = ""]
31444#[doc = "ID: 102"]
31445#[derive(Debug, Clone, PartialEq)]
31446#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31447#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31448pub struct VISION_POSITION_ESTIMATE_DATA {
31449 #[doc = "Timestamp (UNIX time or time since system boot)"]
31450 pub usec: u64,
31451 #[doc = "Local X position"]
31452 pub x: f32,
31453 #[doc = "Local Y position"]
31454 pub y: f32,
31455 #[doc = "Local Z position"]
31456 pub z: f32,
31457 #[doc = "Roll angle"]
31458 pub roll: f32,
31459 #[doc = "Pitch angle"]
31460 pub pitch: f32,
31461 #[doc = "Yaw angle"]
31462 pub yaw: f32,
31463 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31464 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31465 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31466 pub covariance: [f32; 21],
31467 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31468 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31469 pub reset_counter: u8,
31470}
31471impl VISION_POSITION_ESTIMATE_DATA {
31472 pub const ENCODED_LEN: usize = 117usize;
31473 pub const DEFAULT: Self = Self {
31474 usec: 0_u64,
31475 x: 0.0_f32,
31476 y: 0.0_f32,
31477 z: 0.0_f32,
31478 roll: 0.0_f32,
31479 pitch: 0.0_f32,
31480 yaw: 0.0_f32,
31481 covariance: [0.0_f32; 21usize],
31482 reset_counter: 0_u8,
31483 };
31484 #[cfg(feature = "arbitrary")]
31485 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31486 use arbitrary::{Arbitrary, Unstructured};
31487 let mut buf = [0u8; 1024];
31488 rng.fill_bytes(&mut buf);
31489 let mut unstructured = Unstructured::new(&buf);
31490 Self::arbitrary(&mut unstructured).unwrap_or_default()
31491 }
31492}
31493impl Default for VISION_POSITION_ESTIMATE_DATA {
31494 fn default() -> Self {
31495 Self::DEFAULT.clone()
31496 }
31497}
31498impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31499 type Message = MavMessage;
31500 const ID: u32 = 102u32;
31501 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31502 const EXTRA_CRC: u8 = 158u8;
31503 const ENCODED_LEN: usize = 117usize;
31504 fn deser(
31505 _version: MavlinkVersion,
31506 __input: &[u8],
31507 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31508 let avail_len = __input.len();
31509 let mut payload_buf = [0; Self::ENCODED_LEN];
31510 let mut buf = if avail_len < Self::ENCODED_LEN {
31511 payload_buf[0..avail_len].copy_from_slice(__input);
31512 Bytes::new(&payload_buf)
31513 } else {
31514 Bytes::new(__input)
31515 };
31516 let mut __struct = Self::default();
31517 __struct.usec = buf.get_u64_le();
31518 __struct.x = buf.get_f32_le();
31519 __struct.y = buf.get_f32_le();
31520 __struct.z = buf.get_f32_le();
31521 __struct.roll = buf.get_f32_le();
31522 __struct.pitch = buf.get_f32_le();
31523 __struct.yaw = buf.get_f32_le();
31524 for v in &mut __struct.covariance {
31525 let val = buf.get_f32_le();
31526 *v = val;
31527 }
31528 __struct.reset_counter = buf.get_u8();
31529 Ok(__struct)
31530 }
31531 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31532 let mut __tmp = BytesMut::new(bytes);
31533 #[allow(clippy::absurd_extreme_comparisons)]
31534 #[allow(unused_comparisons)]
31535 if __tmp.remaining() < Self::ENCODED_LEN {
31536 panic!(
31537 "buffer is too small (need {} bytes, but got {})",
31538 Self::ENCODED_LEN,
31539 __tmp.remaining(),
31540 )
31541 }
31542 __tmp.put_u64_le(self.usec);
31543 __tmp.put_f32_le(self.x);
31544 __tmp.put_f32_le(self.y);
31545 __tmp.put_f32_le(self.z);
31546 __tmp.put_f32_le(self.roll);
31547 __tmp.put_f32_le(self.pitch);
31548 __tmp.put_f32_le(self.yaw);
31549 if matches!(version, MavlinkVersion::V2) {
31550 for val in &self.covariance {
31551 __tmp.put_f32_le(*val);
31552 }
31553 __tmp.put_u8(self.reset_counter);
31554 let len = __tmp.len();
31555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31556 } else {
31557 __tmp.len()
31558 }
31559 }
31560}
31561#[doc = "Speed estimate from a vision source."]
31562#[doc = ""]
31563#[doc = "ID: 103"]
31564#[derive(Debug, Clone, PartialEq)]
31565#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31567pub struct VISION_SPEED_ESTIMATE_DATA {
31568 #[doc = "Timestamp (UNIX time or time since system boot)"]
31569 pub usec: u64,
31570 #[doc = "Global X speed"]
31571 pub x: f32,
31572 #[doc = "Global Y speed"]
31573 pub y: f32,
31574 #[doc = "Global Z speed"]
31575 pub z: f32,
31576 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
31577 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31578 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31579 pub covariance: [f32; 9],
31580 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31581 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31582 pub reset_counter: u8,
31583}
31584impl VISION_SPEED_ESTIMATE_DATA {
31585 pub const ENCODED_LEN: usize = 57usize;
31586 pub const DEFAULT: Self = Self {
31587 usec: 0_u64,
31588 x: 0.0_f32,
31589 y: 0.0_f32,
31590 z: 0.0_f32,
31591 covariance: [0.0_f32; 9usize],
31592 reset_counter: 0_u8,
31593 };
31594 #[cfg(feature = "arbitrary")]
31595 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31596 use arbitrary::{Arbitrary, Unstructured};
31597 let mut buf = [0u8; 1024];
31598 rng.fill_bytes(&mut buf);
31599 let mut unstructured = Unstructured::new(&buf);
31600 Self::arbitrary(&mut unstructured).unwrap_or_default()
31601 }
31602}
31603impl Default for VISION_SPEED_ESTIMATE_DATA {
31604 fn default() -> Self {
31605 Self::DEFAULT.clone()
31606 }
31607}
31608impl MessageData for VISION_SPEED_ESTIMATE_DATA {
31609 type Message = MavMessage;
31610 const ID: u32 = 103u32;
31611 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
31612 const EXTRA_CRC: u8 = 208u8;
31613 const ENCODED_LEN: usize = 57usize;
31614 fn deser(
31615 _version: MavlinkVersion,
31616 __input: &[u8],
31617 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31618 let avail_len = __input.len();
31619 let mut payload_buf = [0; Self::ENCODED_LEN];
31620 let mut buf = if avail_len < Self::ENCODED_LEN {
31621 payload_buf[0..avail_len].copy_from_slice(__input);
31622 Bytes::new(&payload_buf)
31623 } else {
31624 Bytes::new(__input)
31625 };
31626 let mut __struct = Self::default();
31627 __struct.usec = buf.get_u64_le();
31628 __struct.x = buf.get_f32_le();
31629 __struct.y = buf.get_f32_le();
31630 __struct.z = buf.get_f32_le();
31631 for v in &mut __struct.covariance {
31632 let val = buf.get_f32_le();
31633 *v = val;
31634 }
31635 __struct.reset_counter = buf.get_u8();
31636 Ok(__struct)
31637 }
31638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31639 let mut __tmp = BytesMut::new(bytes);
31640 #[allow(clippy::absurd_extreme_comparisons)]
31641 #[allow(unused_comparisons)]
31642 if __tmp.remaining() < Self::ENCODED_LEN {
31643 panic!(
31644 "buffer is too small (need {} bytes, but got {})",
31645 Self::ENCODED_LEN,
31646 __tmp.remaining(),
31647 )
31648 }
31649 __tmp.put_u64_le(self.usec);
31650 __tmp.put_f32_le(self.x);
31651 __tmp.put_f32_le(self.y);
31652 __tmp.put_f32_le(self.z);
31653 if matches!(version, MavlinkVersion::V2) {
31654 for val in &self.covariance {
31655 __tmp.put_f32_le(*val);
31656 }
31657 __tmp.put_u8(self.reset_counter);
31658 let len = __tmp.len();
31659 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31660 } else {
31661 __tmp.len()
31662 }
31663 }
31664}
31665#[doc = "Cumulative distance traveled for each reported wheel."]
31666#[doc = ""]
31667#[doc = "ID: 9000"]
31668#[derive(Debug, Clone, PartialEq)]
31669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31671pub struct WHEEL_DISTANCE_DATA {
31672 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31673 pub time_usec: u64,
31674 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
31675 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31676 pub distance: [f64; 16],
31677 #[doc = "Number of wheels reported."]
31678 pub count: u8,
31679}
31680impl WHEEL_DISTANCE_DATA {
31681 pub const ENCODED_LEN: usize = 137usize;
31682 pub const DEFAULT: Self = Self {
31683 time_usec: 0_u64,
31684 distance: [0.0_f64; 16usize],
31685 count: 0_u8,
31686 };
31687 #[cfg(feature = "arbitrary")]
31688 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31689 use arbitrary::{Arbitrary, Unstructured};
31690 let mut buf = [0u8; 1024];
31691 rng.fill_bytes(&mut buf);
31692 let mut unstructured = Unstructured::new(&buf);
31693 Self::arbitrary(&mut unstructured).unwrap_or_default()
31694 }
31695}
31696impl Default for WHEEL_DISTANCE_DATA {
31697 fn default() -> Self {
31698 Self::DEFAULT.clone()
31699 }
31700}
31701impl MessageData for WHEEL_DISTANCE_DATA {
31702 type Message = MavMessage;
31703 const ID: u32 = 9000u32;
31704 const NAME: &'static str = "WHEEL_DISTANCE";
31705 const EXTRA_CRC: u8 = 113u8;
31706 const ENCODED_LEN: usize = 137usize;
31707 fn deser(
31708 _version: MavlinkVersion,
31709 __input: &[u8],
31710 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31711 let avail_len = __input.len();
31712 let mut payload_buf = [0; Self::ENCODED_LEN];
31713 let mut buf = if avail_len < Self::ENCODED_LEN {
31714 payload_buf[0..avail_len].copy_from_slice(__input);
31715 Bytes::new(&payload_buf)
31716 } else {
31717 Bytes::new(__input)
31718 };
31719 let mut __struct = Self::default();
31720 __struct.time_usec = buf.get_u64_le();
31721 for v in &mut __struct.distance {
31722 let val = buf.get_f64_le();
31723 *v = val;
31724 }
31725 __struct.count = buf.get_u8();
31726 Ok(__struct)
31727 }
31728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31729 let mut __tmp = BytesMut::new(bytes);
31730 #[allow(clippy::absurd_extreme_comparisons)]
31731 #[allow(unused_comparisons)]
31732 if __tmp.remaining() < Self::ENCODED_LEN {
31733 panic!(
31734 "buffer is too small (need {} bytes, but got {})",
31735 Self::ENCODED_LEN,
31736 __tmp.remaining(),
31737 )
31738 }
31739 __tmp.put_u64_le(self.time_usec);
31740 for val in &self.distance {
31741 __tmp.put_f64_le(*val);
31742 }
31743 __tmp.put_u8(self.count);
31744 if matches!(version, MavlinkVersion::V2) {
31745 let len = __tmp.len();
31746 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31747 } else {
31748 __tmp.len()
31749 }
31750 }
31751}
31752#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31753#[doc = ""]
31754#[doc = "ID: 299"]
31755#[derive(Debug, Clone, PartialEq)]
31756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31757#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31758pub struct WIFI_CONFIG_AP_DATA {
31759 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
31760 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31761 pub ssid: [u8; 32],
31762 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
31763 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31764 pub password: [u8; 64],
31765 #[doc = "WiFi Mode."]
31766 #[cfg_attr(feature = "serde", serde(default))]
31767 pub mode: WifiConfigApMode,
31768 #[doc = "Message acceptance response (sent back to GS)."]
31769 #[cfg_attr(feature = "serde", serde(default))]
31770 pub response: WifiConfigApResponse,
31771}
31772impl WIFI_CONFIG_AP_DATA {
31773 pub const ENCODED_LEN: usize = 98usize;
31774 pub const DEFAULT: Self = Self {
31775 ssid: [0_u8; 32usize],
31776 password: [0_u8; 64usize],
31777 mode: WifiConfigApMode::DEFAULT,
31778 response: WifiConfigApResponse::DEFAULT,
31779 };
31780 #[cfg(feature = "arbitrary")]
31781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31782 use arbitrary::{Arbitrary, Unstructured};
31783 let mut buf = [0u8; 1024];
31784 rng.fill_bytes(&mut buf);
31785 let mut unstructured = Unstructured::new(&buf);
31786 Self::arbitrary(&mut unstructured).unwrap_or_default()
31787 }
31788}
31789impl Default for WIFI_CONFIG_AP_DATA {
31790 fn default() -> Self {
31791 Self::DEFAULT.clone()
31792 }
31793}
31794impl MessageData for WIFI_CONFIG_AP_DATA {
31795 type Message = MavMessage;
31796 const ID: u32 = 299u32;
31797 const NAME: &'static str = "WIFI_CONFIG_AP";
31798 const EXTRA_CRC: u8 = 19u8;
31799 const ENCODED_LEN: usize = 98usize;
31800 fn deser(
31801 _version: MavlinkVersion,
31802 __input: &[u8],
31803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31804 let avail_len = __input.len();
31805 let mut payload_buf = [0; Self::ENCODED_LEN];
31806 let mut buf = if avail_len < Self::ENCODED_LEN {
31807 payload_buf[0..avail_len].copy_from_slice(__input);
31808 Bytes::new(&payload_buf)
31809 } else {
31810 Bytes::new(__input)
31811 };
31812 let mut __struct = Self::default();
31813 for v in &mut __struct.ssid {
31814 let val = buf.get_u8();
31815 *v = val;
31816 }
31817 for v in &mut __struct.password {
31818 let val = buf.get_u8();
31819 *v = val;
31820 }
31821 let tmp = buf.get_i8();
31822 __struct.mode =
31823 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31824 enum_type: "WifiConfigApMode",
31825 value: tmp as u32,
31826 })?;
31827 let tmp = buf.get_i8();
31828 __struct.response =
31829 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31830 enum_type: "WifiConfigApResponse",
31831 value: tmp as u32,
31832 })?;
31833 Ok(__struct)
31834 }
31835 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31836 let mut __tmp = BytesMut::new(bytes);
31837 #[allow(clippy::absurd_extreme_comparisons)]
31838 #[allow(unused_comparisons)]
31839 if __tmp.remaining() < Self::ENCODED_LEN {
31840 panic!(
31841 "buffer is too small (need {} bytes, but got {})",
31842 Self::ENCODED_LEN,
31843 __tmp.remaining(),
31844 )
31845 }
31846 for val in &self.ssid {
31847 __tmp.put_u8(*val);
31848 }
31849 for val in &self.password {
31850 __tmp.put_u8(*val);
31851 }
31852 if matches!(version, MavlinkVersion::V2) {
31853 __tmp.put_i8(self.mode as i8);
31854 __tmp.put_i8(self.response as i8);
31855 let len = __tmp.len();
31856 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31857 } else {
31858 __tmp.len()
31859 }
31860 }
31861}
31862#[doc = "Winch status."]
31863#[doc = ""]
31864#[doc = "ID: 9005"]
31865#[derive(Debug, Clone, PartialEq)]
31866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31868pub struct WINCH_STATUS_DATA {
31869 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31870 pub time_usec: u64,
31871 #[doc = "Length of line released. NaN if unknown"]
31872 pub line_length: f32,
31873 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
31874 pub speed: f32,
31875 #[doc = "Tension on the line. NaN if unknown"]
31876 pub tension: f32,
31877 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
31878 pub voltage: f32,
31879 #[doc = "Current draw from the winch. NaN if unknown"]
31880 pub current: f32,
31881 #[doc = "Status flags"]
31882 pub status: MavWinchStatusFlag,
31883 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31884 pub temperature: i16,
31885}
31886impl WINCH_STATUS_DATA {
31887 pub const ENCODED_LEN: usize = 34usize;
31888 pub const DEFAULT: Self = Self {
31889 time_usec: 0_u64,
31890 line_length: 0.0_f32,
31891 speed: 0.0_f32,
31892 tension: 0.0_f32,
31893 voltage: 0.0_f32,
31894 current: 0.0_f32,
31895 status: MavWinchStatusFlag::DEFAULT,
31896 temperature: 0_i16,
31897 };
31898 #[cfg(feature = "arbitrary")]
31899 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31900 use arbitrary::{Arbitrary, Unstructured};
31901 let mut buf = [0u8; 1024];
31902 rng.fill_bytes(&mut buf);
31903 let mut unstructured = Unstructured::new(&buf);
31904 Self::arbitrary(&mut unstructured).unwrap_or_default()
31905 }
31906}
31907impl Default for WINCH_STATUS_DATA {
31908 fn default() -> Self {
31909 Self::DEFAULT.clone()
31910 }
31911}
31912impl MessageData for WINCH_STATUS_DATA {
31913 type Message = MavMessage;
31914 const ID: u32 = 9005u32;
31915 const NAME: &'static str = "WINCH_STATUS";
31916 const EXTRA_CRC: u8 = 117u8;
31917 const ENCODED_LEN: usize = 34usize;
31918 fn deser(
31919 _version: MavlinkVersion,
31920 __input: &[u8],
31921 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31922 let avail_len = __input.len();
31923 let mut payload_buf = [0; Self::ENCODED_LEN];
31924 let mut buf = if avail_len < Self::ENCODED_LEN {
31925 payload_buf[0..avail_len].copy_from_slice(__input);
31926 Bytes::new(&payload_buf)
31927 } else {
31928 Bytes::new(__input)
31929 };
31930 let mut __struct = Self::default();
31931 __struct.time_usec = buf.get_u64_le();
31932 __struct.line_length = buf.get_f32_le();
31933 __struct.speed = buf.get_f32_le();
31934 __struct.tension = buf.get_f32_le();
31935 __struct.voltage = buf.get_f32_le();
31936 __struct.current = buf.get_f32_le();
31937 let tmp = buf.get_u32_le();
31938 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
31939 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31940 flag_type: "MavWinchStatusFlag",
31941 value: tmp as u32,
31942 })?;
31943 __struct.temperature = buf.get_i16_le();
31944 Ok(__struct)
31945 }
31946 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31947 let mut __tmp = BytesMut::new(bytes);
31948 #[allow(clippy::absurd_extreme_comparisons)]
31949 #[allow(unused_comparisons)]
31950 if __tmp.remaining() < Self::ENCODED_LEN {
31951 panic!(
31952 "buffer is too small (need {} bytes, but got {})",
31953 Self::ENCODED_LEN,
31954 __tmp.remaining(),
31955 )
31956 }
31957 __tmp.put_u64_le(self.time_usec);
31958 __tmp.put_f32_le(self.line_length);
31959 __tmp.put_f32_le(self.speed);
31960 __tmp.put_f32_le(self.tension);
31961 __tmp.put_f32_le(self.voltage);
31962 __tmp.put_f32_le(self.current);
31963 __tmp.put_u32_le(self.status.bits());
31964 __tmp.put_i16_le(self.temperature);
31965 if matches!(version, MavlinkVersion::V2) {
31966 let len = __tmp.len();
31967 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31968 } else {
31969 __tmp.len()
31970 }
31971 }
31972}
31973#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31974#[doc = ""]
31975#[doc = "ID: 231"]
31976#[derive(Debug, Clone, PartialEq)]
31977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31979pub struct WIND_COV_DATA {
31980 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31981 pub time_usec: u64,
31982 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31983 pub wind_x: f32,
31984 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31985 pub wind_y: f32,
31986 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31987 pub wind_z: f32,
31988 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31989 pub var_horiz: f32,
31990 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31991 pub var_vert: f32,
31992 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31993 pub wind_alt: f32,
31994 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31995 pub horiz_accuracy: f32,
31996 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31997 pub vert_accuracy: f32,
31998}
31999impl WIND_COV_DATA {
32000 pub const ENCODED_LEN: usize = 40usize;
32001 pub const DEFAULT: Self = Self {
32002 time_usec: 0_u64,
32003 wind_x: 0.0_f32,
32004 wind_y: 0.0_f32,
32005 wind_z: 0.0_f32,
32006 var_horiz: 0.0_f32,
32007 var_vert: 0.0_f32,
32008 wind_alt: 0.0_f32,
32009 horiz_accuracy: 0.0_f32,
32010 vert_accuracy: 0.0_f32,
32011 };
32012 #[cfg(feature = "arbitrary")]
32013 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32014 use arbitrary::{Arbitrary, Unstructured};
32015 let mut buf = [0u8; 1024];
32016 rng.fill_bytes(&mut buf);
32017 let mut unstructured = Unstructured::new(&buf);
32018 Self::arbitrary(&mut unstructured).unwrap_or_default()
32019 }
32020}
32021impl Default for WIND_COV_DATA {
32022 fn default() -> Self {
32023 Self::DEFAULT.clone()
32024 }
32025}
32026impl MessageData for WIND_COV_DATA {
32027 type Message = MavMessage;
32028 const ID: u32 = 231u32;
32029 const NAME: &'static str = "WIND_COV";
32030 const EXTRA_CRC: u8 = 105u8;
32031 const ENCODED_LEN: usize = 40usize;
32032 fn deser(
32033 _version: MavlinkVersion,
32034 __input: &[u8],
32035 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32036 let avail_len = __input.len();
32037 let mut payload_buf = [0; Self::ENCODED_LEN];
32038 let mut buf = if avail_len < Self::ENCODED_LEN {
32039 payload_buf[0..avail_len].copy_from_slice(__input);
32040 Bytes::new(&payload_buf)
32041 } else {
32042 Bytes::new(__input)
32043 };
32044 let mut __struct = Self::default();
32045 __struct.time_usec = buf.get_u64_le();
32046 __struct.wind_x = buf.get_f32_le();
32047 __struct.wind_y = buf.get_f32_le();
32048 __struct.wind_z = buf.get_f32_le();
32049 __struct.var_horiz = buf.get_f32_le();
32050 __struct.var_vert = buf.get_f32_le();
32051 __struct.wind_alt = buf.get_f32_le();
32052 __struct.horiz_accuracy = buf.get_f32_le();
32053 __struct.vert_accuracy = buf.get_f32_le();
32054 Ok(__struct)
32055 }
32056 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32057 let mut __tmp = BytesMut::new(bytes);
32058 #[allow(clippy::absurd_extreme_comparisons)]
32059 #[allow(unused_comparisons)]
32060 if __tmp.remaining() < Self::ENCODED_LEN {
32061 panic!(
32062 "buffer is too small (need {} bytes, but got {})",
32063 Self::ENCODED_LEN,
32064 __tmp.remaining(),
32065 )
32066 }
32067 __tmp.put_u64_le(self.time_usec);
32068 __tmp.put_f32_le(self.wind_x);
32069 __tmp.put_f32_le(self.wind_y);
32070 __tmp.put_f32_le(self.wind_z);
32071 __tmp.put_f32_le(self.var_horiz);
32072 __tmp.put_f32_le(self.var_vert);
32073 __tmp.put_f32_le(self.wind_alt);
32074 __tmp.put_f32_le(self.horiz_accuracy);
32075 __tmp.put_f32_le(self.vert_accuracy);
32076 if matches!(version, MavlinkVersion::V2) {
32077 let len = __tmp.len();
32078 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32079 } else {
32080 __tmp.len()
32081 }
32082 }
32083}
32084#[derive(Clone, PartialEq, Debug)]
32085#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32086#[cfg_attr(feature = "serde", serde(tag = "type"))]
32087#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32088#[repr(u32)]
32089pub enum MavMessage {
32090 #[doc = "Set the vehicle attitude and body angular rates."]
32091 #[doc = ""]
32092 #[doc = "ID: 140"]
32093 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32094 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
32095 #[doc = ""]
32096 #[doc = "ID: 375"]
32097 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32098 #[doc = "The location and information of an ADSB vehicle."]
32099 #[doc = ""]
32100 #[doc = "ID: 246"]
32101 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32102 #[doc = "The location and information of an AIS vessel."]
32103 #[doc = ""]
32104 #[doc = "ID: 301"]
32105 AIS_VESSEL(AIS_VESSEL_DATA),
32106 #[doc = "The current system altitude."]
32107 #[doc = ""]
32108 #[doc = "ID: 141"]
32109 ALTITUDE(ALTITUDE_DATA),
32110 #[doc = "Array test #0."]
32111 #[doc = ""]
32112 #[doc = "ID: 17150"]
32113 ARRAY_TEST_0(ARRAY_TEST_0_DATA),
32114 #[doc = "Array test #1."]
32115 #[doc = ""]
32116 #[doc = "ID: 17151"]
32117 ARRAY_TEST_1(ARRAY_TEST_1_DATA),
32118 #[doc = "Array test #3."]
32119 #[doc = ""]
32120 #[doc = "ID: 17153"]
32121 ARRAY_TEST_3(ARRAY_TEST_3_DATA),
32122 #[doc = "Array test #4."]
32123 #[doc = ""]
32124 #[doc = "ID: 17154"]
32125 ARRAY_TEST_4(ARRAY_TEST_4_DATA),
32126 #[doc = "Array test #5."]
32127 #[doc = ""]
32128 #[doc = "ID: 17155"]
32129 ARRAY_TEST_5(ARRAY_TEST_5_DATA),
32130 #[doc = "Array test #6."]
32131 #[doc = ""]
32132 #[doc = "ID: 17156"]
32133 ARRAY_TEST_6(ARRAY_TEST_6_DATA),
32134 #[doc = "Array test #7."]
32135 #[doc = ""]
32136 #[doc = "ID: 17157"]
32137 ARRAY_TEST_7(ARRAY_TEST_7_DATA),
32138 #[doc = "Array test #8."]
32139 #[doc = ""]
32140 #[doc = "ID: 17158"]
32141 ARRAY_TEST_8(ARRAY_TEST_8_DATA),
32142 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
32143 #[doc = ""]
32144 #[doc = "ID: 30"]
32145 ATTITUDE(ATTITUDE_DATA),
32146 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32147 #[doc = ""]
32148 #[doc = "ID: 31"]
32149 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32150 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32151 #[doc = ""]
32152 #[doc = "ID: 61"]
32153 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32154 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
32155 #[doc = ""]
32156 #[doc = "ID: 83"]
32157 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32158 #[doc = "Motion capture attitude and position."]
32159 #[doc = ""]
32160 #[doc = "ID: 138"]
32161 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32162 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
32163 #[doc = ""]
32164 #[doc = "ID: 7"]
32165 AUTH_KEY(AUTH_KEY_DATA),
32166 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
32167 #[doc = ""]
32168 #[doc = "ID: 286"]
32169 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32170 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
32171 #[doc = ""]
32172 #[doc = "ID: 148"]
32173 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32174 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
32175 #[doc = ""]
32176 #[doc = "ID: 435"]
32177 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32178 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
32179 #[doc = ""]
32180 #[doc = "ID: 437"]
32181 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32182 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
32183 #[doc = ""]
32184 #[doc = "ID: 372"]
32185 BATTERY_INFO(BATTERY_INFO_DATA),
32186 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
32187 #[doc = ""]
32188 #[doc = "ID: 147"]
32189 BATTERY_STATUS(BATTERY_STATUS_DATA),
32190 #[doc = "Report button state change."]
32191 #[doc = ""]
32192 #[doc = "ID: 257"]
32193 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32194 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32195 #[doc = ""]
32196 #[doc = "ID: 262"]
32197 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32198 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32199 #[doc = ""]
32200 #[doc = "ID: 271"]
32201 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32202 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
32203 #[doc = ""]
32204 #[doc = "ID: 263"]
32205 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32206 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32207 #[doc = ""]
32208 #[doc = "ID: 259"]
32209 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32210 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32211 #[doc = ""]
32212 #[doc = "ID: 260"]
32213 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32214 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
32215 #[doc = ""]
32216 #[doc = "ID: 277"]
32217 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32218 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32219 #[doc = ""]
32220 #[doc = "ID: 276"]
32221 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32222 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32223 #[doc = ""]
32224 #[doc = "ID: 275"]
32225 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32226 #[doc = "Camera-IMU triggering and synchronisation message."]
32227 #[doc = ""]
32228 #[doc = "ID: 112"]
32229 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32230 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
32231 #[doc = ""]
32232 #[doc = "ID: 387"]
32233 CANFD_FRAME(CANFD_FRAME_DATA),
32234 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
32235 #[doc = ""]
32236 #[doc = "ID: 388"]
32237 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32238 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
32239 #[doc = ""]
32240 #[doc = "ID: 386"]
32241 CAN_FRAME(CAN_FRAME_DATA),
32242 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32243 #[doc = ""]
32244 #[doc = "ID: 336"]
32245 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32246 #[doc = "Report current used cellular network status."]
32247 #[doc = ""]
32248 #[doc = "ID: 334"]
32249 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32250 #[doc = "Request to control this MAV."]
32251 #[doc = ""]
32252 #[doc = "ID: 5"]
32253 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32254 #[doc = "Accept / deny control of this MAV."]
32255 #[doc = ""]
32256 #[doc = "ID: 6"]
32257 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32258 #[doc = "Information about a potential collision."]
32259 #[doc = ""]
32260 #[doc = "ID: 247"]
32261 COLLISION(COLLISION_DATA),
32262 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32263 #[doc = ""]
32264 #[doc = "ID: 77"]
32265 COMMAND_ACK(COMMAND_ACK_DATA),
32266 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32267 #[doc = ""]
32268 #[doc = "ID: 80"]
32269 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32270 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32271 #[doc = ""]
32272 #[doc = "ID: 75"]
32273 COMMAND_INT(COMMAND_INT_DATA),
32274 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32275 #[doc = ""]
32276 #[doc = "ID: 76"]
32277 COMMAND_LONG(COMMAND_LONG_DATA),
32278 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
32279 #[doc = ""]
32280 #[doc = "ID: 395"]
32281 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
32282 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
32283 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
32284 #[doc = ""]
32285 #[doc = "ID: 396"]
32286 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
32287 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
32288 #[doc = ""]
32289 #[doc = "ID: 397"]
32290 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
32291 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
32292 #[doc = ""]
32293 #[doc = "ID: 146"]
32294 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
32295 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
32296 #[doc = ""]
32297 #[doc = "ID: 411"]
32298 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
32299 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
32300 #[doc = ""]
32301 #[doc = "ID: 436"]
32302 CURRENT_MODE(CURRENT_MODE_DATA),
32303 #[doc = "Data stream status information."]
32304 #[doc = ""]
32305 #[doc = "ID: 67"]
32306 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
32307 DATA_STREAM(DATA_STREAM_DATA),
32308 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32309 #[doc = ""]
32310 #[doc = "ID: 130"]
32311 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
32312 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
32313 #[doc = ""]
32314 #[doc = "ID: 254"]
32315 DEBUG(DEBUG_DATA),
32316 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
32317 #[doc = ""]
32318 #[doc = "ID: 350"]
32319 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
32320 #[doc = "To debug something using a named 3D vector."]
32321 #[doc = ""]
32322 #[doc = "ID: 250"]
32323 DEBUG_VECT(DEBUG_VECT_DATA),
32324 #[doc = "Distance sensor information for an onboard rangefinder."]
32325 #[doc = ""]
32326 #[doc = "ID: 132"]
32327 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
32328 #[doc = "EFI status output."]
32329 #[doc = ""]
32330 #[doc = "ID: 225"]
32331 EFI_STATUS(EFI_STATUS_DATA),
32332 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32333 #[doc = ""]
32334 #[doc = "ID: 131"]
32335 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
32336 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
32337 #[doc = ""]
32338 #[doc = "ID: 290"]
32339 ESC_INFO(ESC_INFO_DATA),
32340 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
32341 #[doc = ""]
32342 #[doc = "ID: 291"]
32343 ESC_STATUS(ESC_STATUS_DATA),
32344 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
32345 #[doc = ""]
32346 #[doc = "ID: 230"]
32347 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
32348 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
32349 #[doc = ""]
32350 #[doc = "ID: 410"]
32351 EVENT(EVENT_DATA),
32352 #[doc = "Provides state for additional features."]
32353 #[doc = ""]
32354 #[doc = "ID: 245"]
32355 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
32356 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
32357 #[doc = ""]
32358 #[doc = "ID: 162"]
32359 FENCE_STATUS(FENCE_STATUS_DATA),
32360 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
32361 #[doc = ""]
32362 #[doc = "ID: 110"]
32363 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
32364 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
32365 #[doc = ""]
32366 #[doc = "ID: 264"]
32367 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
32368 #[doc = "Current motion information from a designated system."]
32369 #[doc = ""]
32370 #[doc = "ID: 144"]
32371 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
32372 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
32373 #[doc = ""]
32374 #[doc = "ID: 371"]
32375 FUEL_STATUS(FUEL_STATUS_DATA),
32376 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
32377 #[doc = ""]
32378 #[doc = "ID: 373"]
32379 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
32380 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
32381 #[doc = ""]
32382 #[doc = "ID: 285"]
32383 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
32384 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
32385 #[doc = ""]
32386 #[doc = "ID: 283"]
32387 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
32388 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
32389 #[doc = ""]
32390 #[doc = "ID: 284"]
32391 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
32392 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
32393 #[doc = ""]
32394 #[doc = "ID: 280"]
32395 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
32396 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32397 #[doc = ""]
32398 #[doc = "ID: 282"]
32399 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
32400 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32401 #[doc = ""]
32402 #[doc = "ID: 288"]
32403 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
32404 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
32405 #[doc = ""]
32406 #[doc = "ID: 287"]
32407 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
32408 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
32409 #[doc = ""]
32410 #[doc = "ID: 281"]
32411 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
32412 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
32413 #[doc = ""]
32414 #[doc = "ID: 33"]
32415 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
32416 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
32417 #[doc = ""]
32418 #[doc = "ID: 63"]
32419 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
32420 #[doc = "Global position/attitude estimate from a vision source."]
32421 #[doc = ""]
32422 #[doc = "ID: 101"]
32423 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
32424 #[doc = "Second GPS data."]
32425 #[doc = ""]
32426 #[doc = "ID: 124"]
32427 GPS2_RAW(GPS2_RAW_DATA),
32428 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32429 #[doc = ""]
32430 #[doc = "ID: 128"]
32431 GPS2_RTK(GPS2_RTK_DATA),
32432 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
32433 #[doc = ""]
32434 #[doc = "ID: 49"]
32435 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
32436 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
32437 #[doc = ""]
32438 #[doc = "ID: 123"]
32439 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
32440 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
32441 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
32442 #[doc = ""]
32443 #[doc = "ID: 232"]
32444 GPS_INPUT(GPS_INPUT_DATA),
32445 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32446 #[doc = ""]
32447 #[doc = "ID: 24"]
32448 GPS_RAW_INT(GPS_RAW_INT_DATA),
32449 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
32450 #[doc = ""]
32451 #[doc = "ID: 233"]
32452 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32453 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32454 #[doc = ""]
32455 #[doc = "ID: 127"]
32456 GPS_RTK(GPS_RTK_DATA),
32457 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
32458 #[doc = ""]
32459 #[doc = "ID: 25"]
32460 GPS_STATUS(GPS_STATUS_DATA),
32461 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
32462 #[doc = ""]
32463 #[doc = "ID: 0"]
32464 HEARTBEAT(HEARTBEAT_DATA),
32465 #[doc = "The IMU readings in SI units in NED body frame."]
32466 #[doc = ""]
32467 #[doc = "ID: 105"]
32468 HIGHRES_IMU(HIGHRES_IMU_DATA),
32469 #[doc = "Message appropriate for high latency connections like Iridium."]
32470 #[doc = ""]
32471 #[doc = "ID: 234"]
32472 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32473 HIGH_LATENCY(HIGH_LATENCY_DATA),
32474 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
32475 #[doc = ""]
32476 #[doc = "ID: 235"]
32477 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32478 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
32479 #[doc = ""]
32480 #[doc = "ID: 93"]
32481 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32482 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
32483 #[doc = ""]
32484 #[doc = "ID: 91"]
32485 HIL_CONTROLS(HIL_CONTROLS_DATA),
32486 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32487 #[doc = ""]
32488 #[doc = "ID: 113"]
32489 HIL_GPS(HIL_GPS_DATA),
32490 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
32491 #[doc = ""]
32492 #[doc = "ID: 114"]
32493 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32494 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
32495 #[doc = ""]
32496 #[doc = "ID: 92"]
32497 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32498 #[doc = "The IMU readings in SI units in NED body frame."]
32499 #[doc = ""]
32500 #[doc = "ID: 107"]
32501 HIL_SENSOR(HIL_SENSOR_DATA),
32502 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32503 #[doc = ""]
32504 #[doc = "ID: 90"]
32505 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32506 HIL_STATE(HIL_STATE_DATA),
32507 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32508 #[doc = ""]
32509 #[doc = "ID: 115"]
32510 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32511 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
32512 #[doc = ""]
32513 #[doc = "ID: 242"]
32514 HOME_POSITION(HOME_POSITION_DATA),
32515 #[doc = "Temperature and humidity from hygrometer."]
32516 #[doc = ""]
32517 #[doc = "ID: 12920"]
32518 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32519 #[doc = "Illuminator status."]
32520 #[doc = ""]
32521 #[doc = "ID: 440"]
32522 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32523 #[doc = "Status of the Iridium SBD link."]
32524 #[doc = ""]
32525 #[doc = "ID: 335"]
32526 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32527 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
32528 #[doc = ""]
32529 #[doc = "ID: 149"]
32530 LANDING_TARGET(LANDING_TARGET_DATA),
32531 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
32532 #[doc = ""]
32533 #[doc = "ID: 8"]
32534 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32535 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32536 #[doc = ""]
32537 #[doc = "ID: 32"]
32538 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32539 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32540 #[doc = ""]
32541 #[doc = "ID: 64"]
32542 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32543 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32544 #[doc = ""]
32545 #[doc = "ID: 89"]
32546 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32547 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
32548 #[doc = ""]
32549 #[doc = "ID: 268"]
32550 LOGGING_ACK(LOGGING_ACK_DATA),
32551 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
32552 #[doc = ""]
32553 #[doc = "ID: 266"]
32554 LOGGING_DATA(LOGGING_DATA_DATA),
32555 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
32556 #[doc = ""]
32557 #[doc = "ID: 267"]
32558 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
32559 #[doc = "Reply to LOG_REQUEST_DATA."]
32560 #[doc = ""]
32561 #[doc = "ID: 120"]
32562 LOG_DATA(LOG_DATA_DATA),
32563 #[doc = "Reply to LOG_REQUEST_LIST."]
32564 #[doc = ""]
32565 #[doc = "ID: 118"]
32566 LOG_ENTRY(LOG_ENTRY_DATA),
32567 #[doc = "Erase all logs."]
32568 #[doc = ""]
32569 #[doc = "ID: 121"]
32570 LOG_ERASE(LOG_ERASE_DATA),
32571 #[doc = "Request a chunk of a log."]
32572 #[doc = ""]
32573 #[doc = "ID: 119"]
32574 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
32575 #[doc = "Stop log transfer and resume normal logging."]
32576 #[doc = ""]
32577 #[doc = "ID: 122"]
32578 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
32579 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
32580 #[doc = ""]
32581 #[doc = "ID: 117"]
32582 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
32583 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
32584 #[doc = ""]
32585 #[doc = "ID: 192"]
32586 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
32587 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
32588 #[doc = ""]
32589 #[doc = "ID: 69"]
32590 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
32591 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
32592 #[doc = ""]
32593 #[doc = "ID: 81"]
32594 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
32595 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32596 #[doc = ""]
32597 #[doc = "ID: 249"]
32598 MEMORY_VECT(MEMORY_VECT_DATA),
32599 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
32600 #[doc = ""]
32601 #[doc = "ID: 244"]
32602 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
32603 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
32604 #[doc = ""]
32605 #[doc = "ID: 47"]
32606 MISSION_ACK(MISSION_ACK_DATA),
32607 #[doc = "Delete all mission items at once."]
32608 #[doc = ""]
32609 #[doc = "ID: 45"]
32610 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
32611 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
32612 #[doc = ""]
32613 #[doc = "ID: 44"]
32614 MISSION_COUNT(MISSION_COUNT_DATA),
32615 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
32616 #[doc = ""]
32617 #[doc = "ID: 42"]
32618 MISSION_CURRENT(MISSION_CURRENT_DATA),
32619 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32620 #[doc = ""]
32621 #[doc = "ID: 39"]
32622 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
32623 MISSION_ITEM(MISSION_ITEM_DATA),
32624 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32625 #[doc = ""]
32626 #[doc = "ID: 73"]
32627 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
32628 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
32629 #[doc = ""]
32630 #[doc = "ID: 46"]
32631 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
32632 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
32633 #[doc = ""]
32634 #[doc = "ID: 40"]
32635 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
32636 MISSION_REQUEST(MISSION_REQUEST_DATA),
32637 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
32638 #[doc = ""]
32639 #[doc = "ID: 51"]
32640 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
32641 #[doc = "Request the overall list of mission items from the system/component."]
32642 #[doc = ""]
32643 #[doc = "ID: 43"]
32644 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
32645 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
32646 #[doc = ""]
32647 #[doc = "ID: 37"]
32648 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
32649 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
32650 #[doc = ""]
32651 #[doc = "ID: 41"]
32652 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
32653 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
32654 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
32655 #[doc = ""]
32656 #[doc = "ID: 38"]
32657 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
32658 #[doc = "Orientation of a mount."]
32659 #[doc = ""]
32660 #[doc = "ID: 265"]
32661 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
32662 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
32663 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32664 #[doc = ""]
32665 #[doc = "ID: 251"]
32666 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
32667 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32668 #[doc = ""]
32669 #[doc = "ID: 252"]
32670 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
32671 #[doc = "The state of the navigation and position controller."]
32672 #[doc = ""]
32673 #[doc = "ID: 62"]
32674 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
32675 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
32676 #[doc = ""]
32677 #[doc = "ID: 330"]
32678 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
32679 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
32680 #[doc = ""]
32681 #[doc = "ID: 331"]
32682 ODOMETRY(ODOMETRY_DATA),
32683 #[doc = "Hardware status sent by an onboard computer."]
32684 #[doc = ""]
32685 #[doc = "ID: 390"]
32686 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
32687 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
32688 #[doc = ""]
32689 #[doc = "ID: 12918"]
32690 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
32691 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
32692 #[doc = ""]
32693 #[doc = "ID: 12902"]
32694 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
32695 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
32696 #[doc = ""]
32697 #[doc = "ID: 12900"]
32698 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
32699 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
32700 #[doc = ""]
32701 #[doc = "ID: 12901"]
32702 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
32703 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
32704 #[doc = ""]
32705 #[doc = "ID: 12915"]
32706 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
32707 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
32708 #[doc = ""]
32709 #[doc = "ID: 12905"]
32710 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
32711 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
32712 #[doc = ""]
32713 #[doc = "ID: 12903"]
32714 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
32715 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
32716 #[doc = ""]
32717 #[doc = "ID: 12904"]
32718 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
32719 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
32720 #[doc = ""]
32721 #[doc = "ID: 12919"]
32722 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
32723 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
32724 #[doc = ""]
32725 #[doc = "ID: 100"]
32726 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
32727 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
32728 #[doc = ""]
32729 #[doc = "ID: 106"]
32730 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
32731 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
32732 #[doc = ""]
32733 #[doc = "ID: 360"]
32734 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
32735 #[doc = "Response from a PARAM_EXT_SET message."]
32736 #[doc = ""]
32737 #[doc = "ID: 324"]
32738 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
32739 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
32740 #[doc = ""]
32741 #[doc = "ID: 321"]
32742 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
32743 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
32744 #[doc = ""]
32745 #[doc = "ID: 320"]
32746 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
32747 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
32748 #[doc = ""]
32749 #[doc = "ID: 323"]
32750 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
32751 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
32752 #[doc = ""]
32753 #[doc = "ID: 322"]
32754 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
32755 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
32756 #[doc = ""]
32757 #[doc = "ID: 50"]
32758 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
32759 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32760 #[doc = ""]
32761 #[doc = "ID: 21"]
32762 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
32763 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
32764 #[doc = ""]
32765 #[doc = "ID: 20"]
32766 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
32767 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32768 #[doc = ""]
32769 #[doc = "ID: 23"]
32770 PARAM_SET(PARAM_SET_DATA),
32771 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32772 #[doc = ""]
32773 #[doc = "ID: 22"]
32774 PARAM_VALUE(PARAM_VALUE_DATA),
32775 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
32776 #[doc = ""]
32777 #[doc = "ID: 4"]
32778 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
32779 PING(PING_DATA),
32780 #[doc = "Control vehicle tone generation (buzzer)."]
32781 #[doc = ""]
32782 #[doc = "ID: 258"]
32783 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
32784 PLAY_TUNE(PLAY_TUNE_DATA),
32785 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
32786 #[doc = ""]
32787 #[doc = "ID: 400"]
32788 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
32789 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
32790 #[doc = ""]
32791 #[doc = "ID: 87"]
32792 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
32793 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
32794 #[doc = ""]
32795 #[doc = "ID: 85"]
32796 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
32797 #[doc = "Power supply status."]
32798 #[doc = ""]
32799 #[doc = "ID: 125"]
32800 POWER_STATUS(POWER_STATUS_DATA),
32801 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
32802 #[doc = ""]
32803 #[doc = "ID: 300"]
32804 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
32805 #[doc = "Status generated by radio and injected into MAVLink stream."]
32806 #[doc = ""]
32807 #[doc = "ID: 109"]
32808 RADIO_STATUS(RADIO_STATUS_DATA),
32809 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
32810 #[doc = ""]
32811 #[doc = "ID: 27"]
32812 RAW_IMU(RAW_IMU_DATA),
32813 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
32814 #[doc = ""]
32815 #[doc = "ID: 28"]
32816 RAW_PRESSURE(RAW_PRESSURE_DATA),
32817 #[doc = "RPM sensor data message."]
32818 #[doc = ""]
32819 #[doc = "ID: 339"]
32820 RAW_RPM(RAW_RPM_DATA),
32821 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
32822 #[doc = ""]
32823 #[doc = "ID: 65"]
32824 RC_CHANNELS(RC_CHANNELS_DATA),
32825 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
32826 #[doc = ""]
32827 #[doc = "ID: 70"]
32828 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
32829 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
32830 #[doc = ""]
32831 #[doc = "ID: 35"]
32832 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
32833 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
32834 #[doc = ""]
32835 #[doc = "ID: 34"]
32836 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
32837 #[doc = "Request a data stream."]
32838 #[doc = ""]
32839 #[doc = "ID: 66"]
32840 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
32841 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
32842 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
32843 #[doc = ""]
32844 #[doc = "ID: 412"]
32845 REQUEST_EVENT(REQUEST_EVENT_DATA),
32846 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
32847 #[doc = ""]
32848 #[doc = "ID: 142"]
32849 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
32850 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
32851 #[doc = ""]
32852 #[doc = "ID: 413"]
32853 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
32854 #[doc = "Read out the safety zone the MAV currently assumes."]
32855 #[doc = ""]
32856 #[doc = "ID: 55"]
32857 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
32858 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
32859 #[doc = ""]
32860 #[doc = "ID: 54"]
32861 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
32862 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
32863 #[doc = ""]
32864 #[doc = "ID: 26"]
32865 SCALED_IMU(SCALED_IMU_DATA),
32866 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
32867 #[doc = ""]
32868 #[doc = "ID: 116"]
32869 SCALED_IMU2(SCALED_IMU2_DATA),
32870 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
32871 #[doc = ""]
32872 #[doc = "ID: 129"]
32873 SCALED_IMU3(SCALED_IMU3_DATA),
32874 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
32875 #[doc = ""]
32876 #[doc = "ID: 29"]
32877 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
32878 #[doc = "Barometer readings for 2nd barometer."]
32879 #[doc = ""]
32880 #[doc = "ID: 137"]
32881 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
32882 #[doc = "Barometer readings for 3rd barometer."]
32883 #[doc = ""]
32884 #[doc = "ID: 143"]
32885 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
32886 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
32887 #[doc = ""]
32888 #[doc = "ID: 126"]
32889 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
32890 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
32891 #[doc = ""]
32892 #[doc = "ID: 36"]
32893 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
32894 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
32895 #[doc = ""]
32896 #[doc = "ID: 256"]
32897 SETUP_SIGNING(SETUP_SIGNING_DATA),
32898 #[doc = "Set the vehicle attitude and body angular rates."]
32899 #[doc = ""]
32900 #[doc = "ID: 139"]
32901 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
32902 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
32903 #[doc = ""]
32904 #[doc = "ID: 82"]
32905 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
32906 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
32907 #[doc = ""]
32908 #[doc = "ID: 48"]
32909 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
32910 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
32911 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
32912 #[doc = ""]
32913 #[doc = "ID: 243"]
32914 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
32915 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
32916 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
32917 #[doc = ""]
32918 #[doc = "ID: 11"]
32919 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
32920 SET_MODE(SET_MODE_DATA),
32921 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
32922 #[doc = ""]
32923 #[doc = "ID: 86"]
32924 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
32925 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
32926 #[doc = ""]
32927 #[doc = "ID: 84"]
32928 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
32929 #[doc = "Status of simulation environment, if used."]
32930 #[doc = ""]
32931 #[doc = "ID: 108"]
32932 SIM_STATE(SIM_STATE_DATA),
32933 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
32934 #[doc = ""]
32935 #[doc = "ID: 370"]
32936 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
32937 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
32938 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
32939 #[doc = ""]
32940 #[doc = "ID: 253"]
32941 STATUSTEXT(STATUSTEXT_DATA),
32942 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
32943 #[doc = ""]
32944 #[doc = "ID: 261"]
32945 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
32946 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
32947 #[doc = ""]
32948 #[doc = "ID: 401"]
32949 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
32950 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
32951 #[doc = ""]
32952 #[doc = "ID: 2"]
32953 SYSTEM_TIME(SYSTEM_TIME_DATA),
32954 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
32955 #[doc = ""]
32956 #[doc = "ID: 1"]
32957 SYS_STATUS(SYS_STATUS_DATA),
32958 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
32959 #[doc = ""]
32960 #[doc = "ID: 135"]
32961 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
32962 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32963 #[doc = ""]
32964 #[doc = "ID: 134"]
32965 TERRAIN_DATA(TERRAIN_DATA_DATA),
32966 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32967 #[doc = ""]
32968 #[doc = "ID: 136"]
32969 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
32970 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32971 #[doc = ""]
32972 #[doc = "ID: 133"]
32973 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
32974 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
32975 #[doc = ""]
32976 #[doc = "ID: 111"]
32977 TIMESYNC(TIMESYNC_DATA),
32978 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
32979 #[doc = ""]
32980 #[doc = "ID: 380"]
32981 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
32982 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
32983 #[doc = ""]
32984 #[doc = "ID: 333"]
32985 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
32986 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
32987 #[doc = ""]
32988 #[doc = "ID: 332"]
32989 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
32990 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
32991 #[doc = ""]
32992 #[doc = "ID: 385"]
32993 TUNNEL(TUNNEL_DATA),
32994 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
32995 #[doc = ""]
32996 #[doc = "ID: 311"]
32997 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
32998 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
32999 #[doc = ""]
33000 #[doc = "ID: 310"]
33001 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33002 #[doc = "The global position resulting from GPS and sensor fusion."]
33003 #[doc = ""]
33004 #[doc = "ID: 340"]
33005 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33006 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33007 #[doc = ""]
33008 #[doc = "ID: 248"]
33009 V2_EXTENSION(V2_EXTENSION_DATA),
33010 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33011 #[doc = ""]
33012 #[doc = "ID: 74"]
33013 VFR_HUD(VFR_HUD_DATA),
33014 #[doc = "Vibration levels and accelerometer clipping."]
33015 #[doc = ""]
33016 #[doc = "ID: 241"]
33017 VIBRATION(VIBRATION_DATA),
33018 #[doc = "Global position estimate from a Vicon motion system source."]
33019 #[doc = ""]
33020 #[doc = "ID: 104"]
33021 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33022 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33023 #[doc = ""]
33024 #[doc = "ID: 269"]
33025 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33026 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33027 #[doc = ""]
33028 #[doc = "ID: 270"]
33029 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33030 #[doc = "Local position/attitude estimate from a vision source."]
33031 #[doc = ""]
33032 #[doc = "ID: 102"]
33033 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33034 #[doc = "Speed estimate from a vision source."]
33035 #[doc = ""]
33036 #[doc = "ID: 103"]
33037 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33038 #[doc = "Cumulative distance traveled for each reported wheel."]
33039 #[doc = ""]
33040 #[doc = "ID: 9000"]
33041 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33042 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33043 #[doc = ""]
33044 #[doc = "ID: 299"]
33045 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33046 #[doc = "Winch status."]
33047 #[doc = ""]
33048 #[doc = "ID: 9005"]
33049 WINCH_STATUS(WINCH_STATUS_DATA),
33050 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33051 #[doc = ""]
33052 #[doc = "ID: 231"]
33053 WIND_COV(WIND_COV_DATA),
33054}
33055impl MavMessage {
33056 pub const fn all_ids() -> &'static [u32] {
33057 &[
33058 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33059 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33060 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33061 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33062 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33063 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33064 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33065 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33066 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33067 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33068 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
33069 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
33070 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
33071 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
33072 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
33073 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
33074 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
33075 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
33076 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
33077 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
33078 12915u32, 12918u32, 12919u32, 12920u32, 17150u32, 17151u32, 17153u32, 17154u32,
33079 17155u32, 17156u32, 17157u32, 17158u32,
33080 ]
33081 }
33082}
33083impl Message for MavMessage {
33084 fn parse(
33085 version: MavlinkVersion,
33086 id: u32,
33087 payload: &[u8],
33088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33089 match id {
33090 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33091 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33092 .map(Self::ACTUATOR_CONTROL_TARGET)
33093 }
33094 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33095 .map(Self::ACTUATOR_OUTPUT_STATUS),
33096 ADSB_VEHICLE_DATA::ID => {
33097 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33098 }
33099 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33100 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33101 ARRAY_TEST_0_DATA::ID => {
33102 ARRAY_TEST_0_DATA::deser(version, payload).map(Self::ARRAY_TEST_0)
33103 }
33104 ARRAY_TEST_1_DATA::ID => {
33105 ARRAY_TEST_1_DATA::deser(version, payload).map(Self::ARRAY_TEST_1)
33106 }
33107 ARRAY_TEST_3_DATA::ID => {
33108 ARRAY_TEST_3_DATA::deser(version, payload).map(Self::ARRAY_TEST_3)
33109 }
33110 ARRAY_TEST_4_DATA::ID => {
33111 ARRAY_TEST_4_DATA::deser(version, payload).map(Self::ARRAY_TEST_4)
33112 }
33113 ARRAY_TEST_5_DATA::ID => {
33114 ARRAY_TEST_5_DATA::deser(version, payload).map(Self::ARRAY_TEST_5)
33115 }
33116 ARRAY_TEST_6_DATA::ID => {
33117 ARRAY_TEST_6_DATA::deser(version, payload).map(Self::ARRAY_TEST_6)
33118 }
33119 ARRAY_TEST_7_DATA::ID => {
33120 ARRAY_TEST_7_DATA::deser(version, payload).map(Self::ARRAY_TEST_7)
33121 }
33122 ARRAY_TEST_8_DATA::ID => {
33123 ARRAY_TEST_8_DATA::deser(version, payload).map(Self::ARRAY_TEST_8)
33124 }
33125 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33126 ATTITUDE_QUATERNION_DATA::ID => {
33127 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33128 }
33129 ATTITUDE_QUATERNION_COV_DATA::ID => {
33130 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33131 .map(Self::ATTITUDE_QUATERNION_COV)
33132 }
33133 ATTITUDE_TARGET_DATA::ID => {
33134 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33135 }
33136 ATT_POS_MOCAP_DATA::ID => {
33137 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33138 }
33139 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33140 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33141 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33142 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33143 }
33144 AUTOPILOT_VERSION_DATA::ID => {
33145 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33146 }
33147 AVAILABLE_MODES_DATA::ID => {
33148 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33149 }
33150 AVAILABLE_MODES_MONITOR_DATA::ID => {
33151 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33152 .map(Self::AVAILABLE_MODES_MONITOR)
33153 }
33154 BATTERY_INFO_DATA::ID => {
33155 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33156 }
33157 BATTERY_STATUS_DATA::ID => {
33158 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33159 }
33160 BUTTON_CHANGE_DATA::ID => {
33161 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33162 }
33163 CAMERA_CAPTURE_STATUS_DATA::ID => {
33164 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33165 }
33166 CAMERA_FOV_STATUS_DATA::ID => {
33167 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33168 }
33169 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33170 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33171 }
33172 CAMERA_INFORMATION_DATA::ID => {
33173 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33174 }
33175 CAMERA_SETTINGS_DATA::ID => {
33176 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33177 }
33178 CAMERA_THERMAL_RANGE_DATA::ID => {
33179 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33180 }
33181 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33182 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33183 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33184 }
33185 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33186 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33187 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33188 }
33189 CAMERA_TRIGGER_DATA::ID => {
33190 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33191 }
33192 CANFD_FRAME_DATA::ID => {
33193 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33194 }
33195 CAN_FILTER_MODIFY_DATA::ID => {
33196 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33197 }
33198 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33199 CELLULAR_CONFIG_DATA::ID => {
33200 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33201 }
33202 CELLULAR_STATUS_DATA::ID => {
33203 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33204 }
33205 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33206 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33207 .map(Self::CHANGE_OPERATOR_CONTROL)
33208 }
33209 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33210 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33211 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33212 }
33213 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33214 COMMAND_ACK_DATA::ID => {
33215 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33216 }
33217 COMMAND_CANCEL_DATA::ID => {
33218 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33219 }
33220 COMMAND_INT_DATA::ID => {
33221 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33222 }
33223 COMMAND_LONG_DATA::ID => {
33224 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33225 }
33226 COMPONENT_INFORMATION_DATA::ID => {
33227 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33228 }
33229 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33230 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33231 .map(Self::COMPONENT_INFORMATION_BASIC)
33232 }
33233 COMPONENT_METADATA_DATA::ID => {
33234 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33235 }
33236 CONTROL_SYSTEM_STATE_DATA::ID => {
33237 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33238 }
33239 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33240 .map(Self::CURRENT_EVENT_SEQUENCE),
33241 CURRENT_MODE_DATA::ID => {
33242 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33243 }
33244 DATA_STREAM_DATA::ID => {
33245 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33246 }
33247 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33248 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33249 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33250 }
33251 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33252 DEBUG_FLOAT_ARRAY_DATA::ID => {
33253 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33254 }
33255 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33256 DISTANCE_SENSOR_DATA::ID => {
33257 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33258 }
33259 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33260 ENCAPSULATED_DATA_DATA::ID => {
33261 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33262 }
33263 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33264 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33265 ESTIMATOR_STATUS_DATA::ID => {
33266 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33267 }
33268 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33269 EXTENDED_SYS_STATE_DATA::ID => {
33270 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33271 }
33272 FENCE_STATUS_DATA::ID => {
33273 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33274 }
33275 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33276 .map(Self::FILE_TRANSFER_PROTOCOL),
33277 FLIGHT_INFORMATION_DATA::ID => {
33278 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33279 }
33280 FOLLOW_TARGET_DATA::ID => {
33281 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33282 }
33283 FUEL_STATUS_DATA::ID => {
33284 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
33285 }
33286 GENERATOR_STATUS_DATA::ID => {
33287 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
33288 }
33289 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
33290 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
33291 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
33292 }
33293 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
33294 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
33295 .map(Self::GIMBAL_DEVICE_INFORMATION)
33296 }
33297 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
33298 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
33299 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
33300 }
33301 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
33302 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
33303 .map(Self::GIMBAL_MANAGER_INFORMATION)
33304 }
33305 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
33306 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
33307 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
33308 }
33309 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33310 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
33311 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
33312 }
33313 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
33314 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
33315 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
33316 }
33317 GIMBAL_MANAGER_STATUS_DATA::ID => {
33318 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
33319 }
33320 GLOBAL_POSITION_INT_DATA::ID => {
33321 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
33322 }
33323 GLOBAL_POSITION_INT_COV_DATA::ID => {
33324 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
33325 .map(Self::GLOBAL_POSITION_INT_COV)
33326 }
33327 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33328 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33329 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
33330 }
33331 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
33332 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
33333 GPS_GLOBAL_ORIGIN_DATA::ID => {
33334 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
33335 }
33336 GPS_INJECT_DATA_DATA::ID => {
33337 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
33338 }
33339 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
33340 GPS_RAW_INT_DATA::ID => {
33341 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
33342 }
33343 GPS_RTCM_DATA_DATA::ID => {
33344 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
33345 }
33346 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
33347 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
33348 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
33349 HIGHRES_IMU_DATA::ID => {
33350 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
33351 }
33352 HIGH_LATENCY_DATA::ID => {
33353 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
33354 }
33355 HIGH_LATENCY2_DATA::ID => {
33356 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
33357 }
33358 HIL_ACTUATOR_CONTROLS_DATA::ID => {
33359 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
33360 }
33361 HIL_CONTROLS_DATA::ID => {
33362 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
33363 }
33364 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
33365 HIL_OPTICAL_FLOW_DATA::ID => {
33366 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
33367 }
33368 HIL_RC_INPUTS_RAW_DATA::ID => {
33369 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
33370 }
33371 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
33372 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
33373 HIL_STATE_QUATERNION_DATA::ID => {
33374 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
33375 }
33376 HOME_POSITION_DATA::ID => {
33377 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
33378 }
33379 HYGROMETER_SENSOR_DATA::ID => {
33380 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
33381 }
33382 ILLUMINATOR_STATUS_DATA::ID => {
33383 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
33384 }
33385 ISBD_LINK_STATUS_DATA::ID => {
33386 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
33387 }
33388 LANDING_TARGET_DATA::ID => {
33389 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
33390 }
33391 LINK_NODE_STATUS_DATA::ID => {
33392 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
33393 }
33394 LOCAL_POSITION_NED_DATA::ID => {
33395 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
33396 }
33397 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
33398 .map(Self::LOCAL_POSITION_NED_COV),
33399 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33400 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
33401 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
33402 }
33403 LOGGING_ACK_DATA::ID => {
33404 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
33405 }
33406 LOGGING_DATA_DATA::ID => {
33407 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
33408 }
33409 LOGGING_DATA_ACKED_DATA::ID => {
33410 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
33411 }
33412 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
33413 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
33414 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
33415 LOG_REQUEST_DATA_DATA::ID => {
33416 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33417 }
33418 LOG_REQUEST_END_DATA::ID => {
33419 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33420 }
33421 LOG_REQUEST_LIST_DATA::ID => {
33422 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33423 }
33424 MAG_CAL_REPORT_DATA::ID => {
33425 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33426 }
33427 MANUAL_CONTROL_DATA::ID => {
33428 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33429 }
33430 MANUAL_SETPOINT_DATA::ID => {
33431 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33432 }
33433 MEMORY_VECT_DATA::ID => {
33434 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33435 }
33436 MESSAGE_INTERVAL_DATA::ID => {
33437 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33438 }
33439 MISSION_ACK_DATA::ID => {
33440 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33441 }
33442 MISSION_CLEAR_ALL_DATA::ID => {
33443 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33444 }
33445 MISSION_COUNT_DATA::ID => {
33446 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33447 }
33448 MISSION_CURRENT_DATA::ID => {
33449 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33450 }
33451 MISSION_ITEM_DATA::ID => {
33452 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33453 }
33454 MISSION_ITEM_INT_DATA::ID => {
33455 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33456 }
33457 MISSION_ITEM_REACHED_DATA::ID => {
33458 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33459 }
33460 MISSION_REQUEST_DATA::ID => {
33461 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33462 }
33463 MISSION_REQUEST_INT_DATA::ID => {
33464 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33465 }
33466 MISSION_REQUEST_LIST_DATA::ID => {
33467 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33468 }
33469 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33470 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33471 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33472 }
33473 MISSION_SET_CURRENT_DATA::ID => {
33474 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33475 }
33476 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33477 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33478 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33479 }
33480 MOUNT_ORIENTATION_DATA::ID => {
33481 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33482 }
33483 NAMED_VALUE_FLOAT_DATA::ID => {
33484 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33485 }
33486 NAMED_VALUE_INT_DATA::ID => {
33487 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33488 }
33489 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33490 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33491 }
33492 OBSTACLE_DISTANCE_DATA::ID => {
33493 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33494 }
33495 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33496 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33497 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33498 .map(Self::ONBOARD_COMPUTER_STATUS)
33499 }
33500 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33501 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33502 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33503 }
33504 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33505 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33506 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33507 }
33508 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33509 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33510 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33511 .map(Self::OPEN_DRONE_ID_LOCATION),
33512 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33513 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33514 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33515 }
33516 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33517 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33518 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33519 }
33520 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33521 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33522 }
33523 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33524 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33525 }
33526 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33527 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33528 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33529 }
33530 OPTICAL_FLOW_DATA::ID => {
33531 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33532 }
33533 OPTICAL_FLOW_RAD_DATA::ID => {
33534 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33535 }
33536 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33537 .map(Self::ORBIT_EXECUTION_STATUS),
33538 PARAM_EXT_ACK_DATA::ID => {
33539 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33540 }
33541 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33542 .map(Self::PARAM_EXT_REQUEST_LIST),
33543 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33544 .map(Self::PARAM_EXT_REQUEST_READ),
33545 PARAM_EXT_SET_DATA::ID => {
33546 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33547 }
33548 PARAM_EXT_VALUE_DATA::ID => {
33549 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33550 }
33551 PARAM_MAP_RC_DATA::ID => {
33552 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33553 }
33554 PARAM_REQUEST_LIST_DATA::ID => {
33555 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33556 }
33557 PARAM_REQUEST_READ_DATA::ID => {
33558 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33559 }
33560 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33561 PARAM_VALUE_DATA::ID => {
33562 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
33563 }
33564 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
33565 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
33566 PLAY_TUNE_V2_DATA::ID => {
33567 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
33568 }
33569 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33570 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33571 .map(Self::POSITION_TARGET_GLOBAL_INT)
33572 }
33573 POSITION_TARGET_LOCAL_NED_DATA::ID => {
33574 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33575 .map(Self::POSITION_TARGET_LOCAL_NED)
33576 }
33577 POWER_STATUS_DATA::ID => {
33578 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
33579 }
33580 PROTOCOL_VERSION_DATA::ID => {
33581 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
33582 }
33583 RADIO_STATUS_DATA::ID => {
33584 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
33585 }
33586 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
33587 RAW_PRESSURE_DATA::ID => {
33588 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
33589 }
33590 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
33591 RC_CHANNELS_DATA::ID => {
33592 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
33593 }
33594 RC_CHANNELS_OVERRIDE_DATA::ID => {
33595 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
33596 }
33597 RC_CHANNELS_RAW_DATA::ID => {
33598 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
33599 }
33600 RC_CHANNELS_SCALED_DATA::ID => {
33601 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
33602 }
33603 REQUEST_DATA_STREAM_DATA::ID => {
33604 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
33605 }
33606 REQUEST_EVENT_DATA::ID => {
33607 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
33608 }
33609 RESOURCE_REQUEST_DATA::ID => {
33610 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
33611 }
33612 RESPONSE_EVENT_ERROR_DATA::ID => {
33613 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
33614 }
33615 SAFETY_ALLOWED_AREA_DATA::ID => {
33616 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
33617 }
33618 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
33619 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
33620 .map(Self::SAFETY_SET_ALLOWED_AREA)
33621 }
33622 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
33623 SCALED_IMU2_DATA::ID => {
33624 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
33625 }
33626 SCALED_IMU3_DATA::ID => {
33627 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
33628 }
33629 SCALED_PRESSURE_DATA::ID => {
33630 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
33631 }
33632 SCALED_PRESSURE2_DATA::ID => {
33633 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
33634 }
33635 SCALED_PRESSURE3_DATA::ID => {
33636 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
33637 }
33638 SERIAL_CONTROL_DATA::ID => {
33639 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
33640 }
33641 SERVO_OUTPUT_RAW_DATA::ID => {
33642 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
33643 }
33644 SETUP_SIGNING_DATA::ID => {
33645 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
33646 }
33647 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
33648 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33649 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
33650 }
33651 SET_ATTITUDE_TARGET_DATA::ID => {
33652 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
33653 }
33654 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
33655 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
33656 }
33657 SET_HOME_POSITION_DATA::ID => {
33658 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
33659 }
33660 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
33661 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33662 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33663 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
33664 }
33665 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
33666 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33667 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
33668 }
33669 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
33670 SMART_BATTERY_INFO_DATA::ID => {
33671 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
33672 }
33673 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
33674 STORAGE_INFORMATION_DATA::ID => {
33675 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
33676 }
33677 SUPPORTED_TUNES_DATA::ID => {
33678 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
33679 }
33680 SYSTEM_TIME_DATA::ID => {
33681 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
33682 }
33683 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
33684 TERRAIN_CHECK_DATA::ID => {
33685 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
33686 }
33687 TERRAIN_DATA_DATA::ID => {
33688 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
33689 }
33690 TERRAIN_REPORT_DATA::ID => {
33691 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
33692 }
33693 TERRAIN_REQUEST_DATA::ID => {
33694 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
33695 }
33696 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
33697 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
33698 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
33699 .map(Self::TIME_ESTIMATE_TO_TARGET)
33700 }
33701 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33702 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
33703 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
33704 }
33705 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33706 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
33707 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
33708 }
33709 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
33710 UAVCAN_NODE_INFO_DATA::ID => {
33711 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
33712 }
33713 UAVCAN_NODE_STATUS_DATA::ID => {
33714 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
33715 }
33716 UTM_GLOBAL_POSITION_DATA::ID => {
33717 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
33718 }
33719 V2_EXTENSION_DATA::ID => {
33720 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
33721 }
33722 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
33723 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
33724 VICON_POSITION_ESTIMATE_DATA::ID => {
33725 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
33726 .map(Self::VICON_POSITION_ESTIMATE)
33727 }
33728 VIDEO_STREAM_INFORMATION_DATA::ID => {
33729 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
33730 .map(Self::VIDEO_STREAM_INFORMATION)
33731 }
33732 VIDEO_STREAM_STATUS_DATA::ID => {
33733 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
33734 }
33735 VISION_POSITION_ESTIMATE_DATA::ID => {
33736 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33737 .map(Self::VISION_POSITION_ESTIMATE)
33738 }
33739 VISION_SPEED_ESTIMATE_DATA::ID => {
33740 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
33741 }
33742 WHEEL_DISTANCE_DATA::ID => {
33743 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
33744 }
33745 WIFI_CONFIG_AP_DATA::ID => {
33746 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
33747 }
33748 WINCH_STATUS_DATA::ID => {
33749 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
33750 }
33751 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
33752 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
33753 }
33754 }
33755 fn message_name(&self) -> &'static str {
33756 match self {
33757 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
33758 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
33759 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
33760 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
33761 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
33762 Self::ARRAY_TEST_0(..) => ARRAY_TEST_0_DATA::NAME,
33763 Self::ARRAY_TEST_1(..) => ARRAY_TEST_1_DATA::NAME,
33764 Self::ARRAY_TEST_3(..) => ARRAY_TEST_3_DATA::NAME,
33765 Self::ARRAY_TEST_4(..) => ARRAY_TEST_4_DATA::NAME,
33766 Self::ARRAY_TEST_5(..) => ARRAY_TEST_5_DATA::NAME,
33767 Self::ARRAY_TEST_6(..) => ARRAY_TEST_6_DATA::NAME,
33768 Self::ARRAY_TEST_7(..) => ARRAY_TEST_7_DATA::NAME,
33769 Self::ARRAY_TEST_8(..) => ARRAY_TEST_8_DATA::NAME,
33770 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
33771 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
33772 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
33773 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
33774 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
33775 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
33776 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33777 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
33778 }
33779 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
33780 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
33781 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
33782 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
33783 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
33784 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
33785 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
33786 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
33787 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
33788 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
33789 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
33790 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
33791 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
33792 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
33793 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
33794 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
33795 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
33796 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
33797 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
33798 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
33799 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
33800 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
33801 Self::COLLISION(..) => COLLISION_DATA::NAME,
33802 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
33803 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
33804 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
33805 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
33806 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
33807 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
33808 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
33809 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
33810 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
33811 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
33812 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
33813 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
33814 Self::DEBUG(..) => DEBUG_DATA::NAME,
33815 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
33816 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
33817 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
33818 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
33819 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
33820 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
33821 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
33822 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
33823 Self::EVENT(..) => EVENT_DATA::NAME,
33824 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
33825 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
33826 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
33827 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
33828 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
33829 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
33830 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
33831 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
33832 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
33833 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
33834 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
33835 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
33836 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33837 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
33838 }
33839 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
33840 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
33841 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
33842 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
33843 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
33844 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
33845 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
33846 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
33847 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
33848 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
33849 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
33850 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
33851 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
33852 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
33853 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
33854 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
33855 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
33856 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
33857 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
33858 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
33859 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
33860 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
33861 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
33862 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
33863 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
33864 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
33865 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
33866 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
33867 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
33868 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
33869 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
33870 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
33871 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
33872 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
33873 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33874 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
33875 }
33876 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
33877 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
33878 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
33879 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
33880 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
33881 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
33882 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
33883 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
33884 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
33885 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
33886 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
33887 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
33888 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
33889 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
33890 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
33891 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
33892 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
33893 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
33894 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
33895 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
33896 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
33897 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
33898 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
33899 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
33900 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
33901 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
33902 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
33903 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
33904 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
33905 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
33906 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
33907 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
33908 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
33909 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
33910 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
33911 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
33912 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
33913 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
33914 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
33915 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
33916 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
33917 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
33918 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
33919 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
33920 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
33921 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
33922 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
33923 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
33924 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
33925 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
33926 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
33927 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
33928 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
33929 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
33930 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
33931 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
33932 Self::PING(..) => PING_DATA::NAME,
33933 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
33934 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
33935 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33936 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
33937 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
33938 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
33939 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
33940 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
33941 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
33942 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
33943 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
33944 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
33945 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
33946 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
33947 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
33948 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
33949 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
33950 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
33951 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
33952 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
33953 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
33954 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
33955 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
33956 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
33957 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
33958 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
33959 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
33960 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
33961 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
33962 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
33963 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
33964 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
33965 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
33966 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
33967 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33968 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
33969 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
33970 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
33971 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
33972 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
33973 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
33974 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
33975 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
33976 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
33977 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
33978 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
33979 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
33980 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
33981 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
33982 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
33983 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
33984 }
33985 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33986 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
33987 }
33988 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
33989 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
33990 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
33991 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
33992 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
33993 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
33994 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
33995 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
33996 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
33997 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
33998 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
33999 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
34000 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34001 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34002 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34003 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34004 }
34005 }
34006 fn message_id(&self) -> u32 {
34007 match self {
34008 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34009 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34010 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34011 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34012 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34013 Self::ARRAY_TEST_0(..) => ARRAY_TEST_0_DATA::ID,
34014 Self::ARRAY_TEST_1(..) => ARRAY_TEST_1_DATA::ID,
34015 Self::ARRAY_TEST_3(..) => ARRAY_TEST_3_DATA::ID,
34016 Self::ARRAY_TEST_4(..) => ARRAY_TEST_4_DATA::ID,
34017 Self::ARRAY_TEST_5(..) => ARRAY_TEST_5_DATA::ID,
34018 Self::ARRAY_TEST_6(..) => ARRAY_TEST_6_DATA::ID,
34019 Self::ARRAY_TEST_7(..) => ARRAY_TEST_7_DATA::ID,
34020 Self::ARRAY_TEST_8(..) => ARRAY_TEST_8_DATA::ID,
34021 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34022 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34023 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34024 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34025 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34026 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34027 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34028 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34029 }
34030 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34031 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34032 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34033 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34034 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34035 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34036 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34037 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34038 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34039 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34040 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34041 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34042 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34043 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34044 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34045 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34046 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34047 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34048 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34049 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34050 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34051 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34052 Self::COLLISION(..) => COLLISION_DATA::ID,
34053 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34054 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34055 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34056 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34057 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34058 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34059 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34060 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34061 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34062 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34063 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34064 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34065 Self::DEBUG(..) => DEBUG_DATA::ID,
34066 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34067 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34068 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34069 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34070 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34071 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34072 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34073 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34074 Self::EVENT(..) => EVENT_DATA::ID,
34075 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34076 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34077 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34078 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34079 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34080 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34081 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34082 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34083 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34084 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34085 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34086 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34087 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34088 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34089 }
34090 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34091 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34092 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34093 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34094 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34095 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34096 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34097 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34098 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34099 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34100 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34101 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34102 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34103 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34104 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34105 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34106 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34107 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34108 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34109 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34110 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34111 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34112 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34113 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34114 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34115 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34116 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34117 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34118 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34119 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34120 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34121 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34122 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34123 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34124 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34125 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34126 }
34127 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34128 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34129 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34130 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34131 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34132 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34133 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34134 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34135 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34136 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34137 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34138 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34139 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34140 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34141 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34142 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34143 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34144 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34145 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34146 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34147 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34148 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34149 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34150 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34151 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34152 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34153 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34154 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34155 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34156 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34157 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34158 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34159 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34160 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34161 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34162 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34163 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34164 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34165 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34166 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34167 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34168 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34169 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34170 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34171 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34172 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34173 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34174 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34175 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34176 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34177 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34178 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34179 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34180 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34181 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34182 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34183 Self::PING(..) => PING_DATA::ID,
34184 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34185 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34186 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34187 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34188 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34189 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34190 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34191 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34192 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34193 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34194 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34195 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34196 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34197 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34198 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34199 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34200 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34201 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34202 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34203 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34204 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34205 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34206 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34207 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34208 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34209 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34210 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34211 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34212 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34213 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34214 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34215 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34216 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34217 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34218 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34219 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34220 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34221 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34222 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34223 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34224 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34225 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34226 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34227 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34228 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34229 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34230 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34231 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34232 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34233 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34234 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34235 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34236 }
34237 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34238 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34239 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34240 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34241 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34242 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34243 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34244 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34245 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34246 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34247 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34248 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34249 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34250 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34251 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34252 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34253 }
34254 }
34255 fn message_id_from_name(name: &str) -> Option<u32> {
34256 match name {
34257 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34258 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34259 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34260 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34261 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34262 ARRAY_TEST_0_DATA::NAME => Some(ARRAY_TEST_0_DATA::ID),
34263 ARRAY_TEST_1_DATA::NAME => Some(ARRAY_TEST_1_DATA::ID),
34264 ARRAY_TEST_3_DATA::NAME => Some(ARRAY_TEST_3_DATA::ID),
34265 ARRAY_TEST_4_DATA::NAME => Some(ARRAY_TEST_4_DATA::ID),
34266 ARRAY_TEST_5_DATA::NAME => Some(ARRAY_TEST_5_DATA::ID),
34267 ARRAY_TEST_6_DATA::NAME => Some(ARRAY_TEST_6_DATA::ID),
34268 ARRAY_TEST_7_DATA::NAME => Some(ARRAY_TEST_7_DATA::ID),
34269 ARRAY_TEST_8_DATA::NAME => Some(ARRAY_TEST_8_DATA::ID),
34270 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34271 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34272 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34273 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34274 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34275 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34276 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34277 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34278 }
34279 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34280 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34281 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34282 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
34283 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
34284 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
34285 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
34286 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
34287 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
34288 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
34289 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
34290 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
34291 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
34292 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
34293 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
34294 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
34295 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
34296 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
34297 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
34298 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
34299 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
34300 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34301 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34302 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34303 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34304 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34305 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34306 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34307 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34308 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34309 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34310 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34311 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34312 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34313 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34314 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34315 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34316 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34317 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34318 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
34319 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
34320 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
34321 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
34322 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
34323 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
34324 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
34325 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
34326 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
34327 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
34328 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
34329 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
34330 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
34331 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
34332 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
34333 }
34334 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
34335 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
34336 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
34337 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
34338 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
34339 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
34340 }
34341 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
34342 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
34343 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
34344 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
34345 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
34346 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
34347 }
34348 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
34349 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
34350 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
34351 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
34352 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
34353 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
34354 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
34355 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
34356 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
34357 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
34358 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
34359 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
34360 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
34361 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
34362 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
34363 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
34364 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
34365 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
34366 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
34367 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
34368 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
34369 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
34370 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
34371 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
34372 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
34373 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
34374 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
34375 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
34376 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
34377 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
34378 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
34379 }
34380 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
34381 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
34382 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
34383 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
34384 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
34385 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
34386 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
34387 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
34388 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
34389 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
34390 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
34391 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
34392 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
34393 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
34394 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
34395 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
34396 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
34397 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
34398 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
34399 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
34400 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
34401 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
34402 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
34403 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
34404 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
34405 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
34406 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
34407 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
34408 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
34409 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
34410 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
34411 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
34412 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
34413 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
34414 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
34415 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
34416 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
34417 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
34418 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
34419 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
34420 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
34421 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
34422 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
34423 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
34424 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
34425 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
34426 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
34427 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
34428 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34429 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34430 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34431 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34432 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34433 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34434 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34435 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34436 PING_DATA::NAME => Some(PING_DATA::ID),
34437 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34438 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34439 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34440 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34441 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34442 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34443 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34444 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34445 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34446 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34447 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34448 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34449 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34450 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34451 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34452 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34453 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34454 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34455 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34456 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34457 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34458 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34459 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34460 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34461 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34462 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34463 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34464 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34465 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34466 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34467 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34468 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34469 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34470 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34471 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34472 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34473 }
34474 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34475 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34476 }
34477 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34478 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34479 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34480 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34481 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34482 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34483 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34484 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34485 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34486 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34487 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34488 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34489 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34490 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34491 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34492 }
34493 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34494 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34495 }
34496 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34497 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34498 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34499 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34500 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34501 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34502 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34503 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34504 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34505 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34506 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34507 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34508 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34509 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34510 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34511 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34512 _ => None,
34513 }
34514 }
34515 fn default_message_from_id(id: u32) -> Option<Self> {
34516 match id {
34517 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34518 ACTUATOR_CONTROL_TARGET_DATA::default(),
34519 )),
34520 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34521 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34522 )),
34523 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34524 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34525 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34526 ARRAY_TEST_0_DATA::ID => Some(Self::ARRAY_TEST_0(ARRAY_TEST_0_DATA::default())),
34527 ARRAY_TEST_1_DATA::ID => Some(Self::ARRAY_TEST_1(ARRAY_TEST_1_DATA::default())),
34528 ARRAY_TEST_3_DATA::ID => Some(Self::ARRAY_TEST_3(ARRAY_TEST_3_DATA::default())),
34529 ARRAY_TEST_4_DATA::ID => Some(Self::ARRAY_TEST_4(ARRAY_TEST_4_DATA::default())),
34530 ARRAY_TEST_5_DATA::ID => Some(Self::ARRAY_TEST_5(ARRAY_TEST_5_DATA::default())),
34531 ARRAY_TEST_6_DATA::ID => Some(Self::ARRAY_TEST_6(ARRAY_TEST_6_DATA::default())),
34532 ARRAY_TEST_7_DATA::ID => Some(Self::ARRAY_TEST_7(ARRAY_TEST_7_DATA::default())),
34533 ARRAY_TEST_8_DATA::ID => Some(Self::ARRAY_TEST_8(ARRAY_TEST_8_DATA::default())),
34534 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34535 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34536 ATTITUDE_QUATERNION_DATA::default(),
34537 )),
34538 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34539 ATTITUDE_QUATERNION_COV_DATA::default(),
34540 )),
34541 ATTITUDE_TARGET_DATA::ID => {
34542 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34543 }
34544 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34545 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34546 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34547 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34548 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34549 ))
34550 }
34551 AUTOPILOT_VERSION_DATA::ID => {
34552 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34553 }
34554 AVAILABLE_MODES_DATA::ID => {
34555 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34556 }
34557 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34558 AVAILABLE_MODES_MONITOR_DATA::default(),
34559 )),
34560 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34561 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34562 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34563 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34564 CAMERA_CAPTURE_STATUS_DATA::default(),
34565 )),
34566 CAMERA_FOV_STATUS_DATA::ID => {
34567 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34568 }
34569 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34570 CAMERA_IMAGE_CAPTURED_DATA::default(),
34571 )),
34572 CAMERA_INFORMATION_DATA::ID => {
34573 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
34574 }
34575 CAMERA_SETTINGS_DATA::ID => {
34576 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
34577 }
34578 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34579 CAMERA_THERMAL_RANGE_DATA::default(),
34580 )),
34581 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34582 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
34583 )),
34584 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34585 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
34586 )),
34587 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
34588 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
34589 CAN_FILTER_MODIFY_DATA::ID => {
34590 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
34591 }
34592 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
34593 CELLULAR_CONFIG_DATA::ID => {
34594 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
34595 }
34596 CELLULAR_STATUS_DATA::ID => {
34597 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
34598 }
34599 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34600 CHANGE_OPERATOR_CONTROL_DATA::default(),
34601 )),
34602 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34603 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
34604 )),
34605 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
34606 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
34607 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
34608 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
34609 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
34610 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34611 COMPONENT_INFORMATION_DATA::default(),
34612 )),
34613 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34614 COMPONENT_INFORMATION_BASIC_DATA::default(),
34615 )),
34616 COMPONENT_METADATA_DATA::ID => {
34617 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
34618 }
34619 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34620 CONTROL_SYSTEM_STATE_DATA::default(),
34621 )),
34622 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34623 CURRENT_EVENT_SEQUENCE_DATA::default(),
34624 )),
34625 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
34626 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
34627 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34628 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
34629 )),
34630 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
34631 DEBUG_FLOAT_ARRAY_DATA::ID => {
34632 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
34633 }
34634 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
34635 DISTANCE_SENSOR_DATA::ID => {
34636 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
34637 }
34638 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
34639 ENCAPSULATED_DATA_DATA::ID => {
34640 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
34641 }
34642 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
34643 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
34644 ESTIMATOR_STATUS_DATA::ID => {
34645 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
34646 }
34647 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
34648 EXTENDED_SYS_STATE_DATA::ID => {
34649 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
34650 }
34651 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
34652 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34653 FILE_TRANSFER_PROTOCOL_DATA::default(),
34654 )),
34655 FLIGHT_INFORMATION_DATA::ID => {
34656 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
34657 }
34658 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
34659 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
34660 GENERATOR_STATUS_DATA::ID => {
34661 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
34662 }
34663 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34664 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
34665 )),
34666 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34667 GIMBAL_DEVICE_INFORMATION_DATA::default(),
34668 )),
34669 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34670 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
34671 )),
34672 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34673 GIMBAL_MANAGER_INFORMATION_DATA::default(),
34674 )),
34675 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34676 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
34677 )),
34678 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34679 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34680 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
34681 ))
34682 }
34683 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34684 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
34685 )),
34686 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34687 GIMBAL_MANAGER_STATUS_DATA::default(),
34688 )),
34689 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34690 GLOBAL_POSITION_INT_DATA::default(),
34691 )),
34692 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34693 GLOBAL_POSITION_INT_COV_DATA::default(),
34694 )),
34695 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34696 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34697 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
34698 ))
34699 }
34700 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
34701 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
34702 GPS_GLOBAL_ORIGIN_DATA::ID => {
34703 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
34704 }
34705 GPS_INJECT_DATA_DATA::ID => {
34706 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
34707 }
34708 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
34709 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
34710 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
34711 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
34712 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
34713 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
34714 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
34715 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
34716 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
34717 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34718 HIL_ACTUATOR_CONTROLS_DATA::default(),
34719 )),
34720 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
34721 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
34722 HIL_OPTICAL_FLOW_DATA::ID => {
34723 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
34724 }
34725 HIL_RC_INPUTS_RAW_DATA::ID => {
34726 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
34727 }
34728 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
34729 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
34730 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34731 HIL_STATE_QUATERNION_DATA::default(),
34732 )),
34733 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
34734 HYGROMETER_SENSOR_DATA::ID => {
34735 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
34736 }
34737 ILLUMINATOR_STATUS_DATA::ID => {
34738 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
34739 }
34740 ISBD_LINK_STATUS_DATA::ID => {
34741 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
34742 }
34743 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
34744 LINK_NODE_STATUS_DATA::ID => {
34745 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
34746 }
34747 LOCAL_POSITION_NED_DATA::ID => {
34748 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
34749 }
34750 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34751 LOCAL_POSITION_NED_COV_DATA::default(),
34752 )),
34753 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34754 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34755 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
34756 ))
34757 }
34758 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
34759 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
34760 LOGGING_DATA_ACKED_DATA::ID => {
34761 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
34762 }
34763 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
34764 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
34765 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
34766 LOG_REQUEST_DATA_DATA::ID => {
34767 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
34768 }
34769 LOG_REQUEST_END_DATA::ID => {
34770 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
34771 }
34772 LOG_REQUEST_LIST_DATA::ID => {
34773 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
34774 }
34775 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
34776 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
34777 MANUAL_SETPOINT_DATA::ID => {
34778 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
34779 }
34780 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
34781 MESSAGE_INTERVAL_DATA::ID => {
34782 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
34783 }
34784 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
34785 MISSION_CLEAR_ALL_DATA::ID => {
34786 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
34787 }
34788 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
34789 MISSION_CURRENT_DATA::ID => {
34790 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
34791 }
34792 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
34793 MISSION_ITEM_INT_DATA::ID => {
34794 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
34795 }
34796 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34797 MISSION_ITEM_REACHED_DATA::default(),
34798 )),
34799 MISSION_REQUEST_DATA::ID => {
34800 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
34801 }
34802 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34803 MISSION_REQUEST_INT_DATA::default(),
34804 )),
34805 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34806 MISSION_REQUEST_LIST_DATA::default(),
34807 )),
34808 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34809 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
34810 )),
34811 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34812 MISSION_SET_CURRENT_DATA::default(),
34813 )),
34814 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34815 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
34816 )),
34817 MOUNT_ORIENTATION_DATA::ID => {
34818 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
34819 }
34820 NAMED_VALUE_FLOAT_DATA::ID => {
34821 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
34822 }
34823 NAMED_VALUE_INT_DATA::ID => {
34824 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
34825 }
34826 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34827 NAV_CONTROLLER_OUTPUT_DATA::default(),
34828 )),
34829 OBSTACLE_DISTANCE_DATA::ID => {
34830 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
34831 }
34832 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
34833 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34834 ONBOARD_COMPUTER_STATUS_DATA::default(),
34835 )),
34836 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34837 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
34838 )),
34839 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34840 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
34841 )),
34842 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34843 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
34844 )),
34845 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34846 OPEN_DRONE_ID_LOCATION_DATA::default(),
34847 )),
34848 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34849 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
34850 )),
34851 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34852 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
34853 )),
34854 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34855 OPEN_DRONE_ID_SELF_ID_DATA::default(),
34856 )),
34857 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34858 OPEN_DRONE_ID_SYSTEM_DATA::default(),
34859 )),
34860 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34861 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
34862 )),
34863 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
34864 OPTICAL_FLOW_RAD_DATA::ID => {
34865 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
34866 }
34867 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34868 ORBIT_EXECUTION_STATUS_DATA::default(),
34869 )),
34870 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
34871 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34872 PARAM_EXT_REQUEST_LIST_DATA::default(),
34873 )),
34874 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34875 PARAM_EXT_REQUEST_READ_DATA::default(),
34876 )),
34877 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
34878 PARAM_EXT_VALUE_DATA::ID => {
34879 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
34880 }
34881 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
34882 PARAM_REQUEST_LIST_DATA::ID => {
34883 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
34884 }
34885 PARAM_REQUEST_READ_DATA::ID => {
34886 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
34887 }
34888 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
34889 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
34890 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
34891 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
34892 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
34893 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34894 POSITION_TARGET_GLOBAL_INT_DATA::default(),
34895 )),
34896 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34897 POSITION_TARGET_LOCAL_NED_DATA::default(),
34898 )),
34899 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
34900 PROTOCOL_VERSION_DATA::ID => {
34901 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
34902 }
34903 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
34904 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
34905 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
34906 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
34907 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
34908 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34909 RC_CHANNELS_OVERRIDE_DATA::default(),
34910 )),
34911 RC_CHANNELS_RAW_DATA::ID => {
34912 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
34913 }
34914 RC_CHANNELS_SCALED_DATA::ID => {
34915 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
34916 }
34917 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34918 REQUEST_DATA_STREAM_DATA::default(),
34919 )),
34920 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
34921 RESOURCE_REQUEST_DATA::ID => {
34922 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
34923 }
34924 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34925 RESPONSE_EVENT_ERROR_DATA::default(),
34926 )),
34927 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34928 SAFETY_ALLOWED_AREA_DATA::default(),
34929 )),
34930 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34931 SAFETY_SET_ALLOWED_AREA_DATA::default(),
34932 )),
34933 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
34934 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
34935 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
34936 SCALED_PRESSURE_DATA::ID => {
34937 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
34938 }
34939 SCALED_PRESSURE2_DATA::ID => {
34940 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
34941 }
34942 SCALED_PRESSURE3_DATA::ID => {
34943 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
34944 }
34945 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
34946 SERVO_OUTPUT_RAW_DATA::ID => {
34947 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
34948 }
34949 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
34950 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34951 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
34952 )),
34953 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34954 SET_ATTITUDE_TARGET_DATA::default(),
34955 )),
34956 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34957 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
34958 )),
34959 SET_HOME_POSITION_DATA::ID => {
34960 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
34961 }
34962 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
34963 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34964 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
34965 )),
34966 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34967 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
34968 )),
34969 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
34970 SMART_BATTERY_INFO_DATA::ID => {
34971 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
34972 }
34973 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
34974 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34975 STORAGE_INFORMATION_DATA::default(),
34976 )),
34977 SUPPORTED_TUNES_DATA::ID => {
34978 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
34979 }
34980 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
34981 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
34982 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
34983 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
34984 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
34985 TERRAIN_REQUEST_DATA::ID => {
34986 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
34987 }
34988 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
34989 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34990 TIME_ESTIMATE_TO_TARGET_DATA::default(),
34991 )),
34992 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34993 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34994 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
34995 ))
34996 }
34997 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34998 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34999 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35000 ))
35001 }
35002 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35003 UAVCAN_NODE_INFO_DATA::ID => {
35004 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
35005 }
35006 UAVCAN_NODE_STATUS_DATA::ID => {
35007 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35008 }
35009 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35010 UTM_GLOBAL_POSITION_DATA::default(),
35011 )),
35012 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35013 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
35014 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35015 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35016 VICON_POSITION_ESTIMATE_DATA::default(),
35017 )),
35018 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35019 VIDEO_STREAM_INFORMATION_DATA::default(),
35020 )),
35021 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35022 VIDEO_STREAM_STATUS_DATA::default(),
35023 )),
35024 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35025 VISION_POSITION_ESTIMATE_DATA::default(),
35026 )),
35027 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35028 VISION_SPEED_ESTIMATE_DATA::default(),
35029 )),
35030 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
35031 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
35032 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
35033 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
35034 _ => None,
35035 }
35036 }
35037 #[cfg(feature = "arbitrary")]
35038 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35039 match id {
35040 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35041 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35042 )),
35043 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35044 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35045 )),
35046 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35047 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35048 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35049 ARRAY_TEST_0_DATA::ID => Some(Self::ARRAY_TEST_0(ARRAY_TEST_0_DATA::random(rng))),
35050 ARRAY_TEST_1_DATA::ID => Some(Self::ARRAY_TEST_1(ARRAY_TEST_1_DATA::random(rng))),
35051 ARRAY_TEST_3_DATA::ID => Some(Self::ARRAY_TEST_3(ARRAY_TEST_3_DATA::random(rng))),
35052 ARRAY_TEST_4_DATA::ID => Some(Self::ARRAY_TEST_4(ARRAY_TEST_4_DATA::random(rng))),
35053 ARRAY_TEST_5_DATA::ID => Some(Self::ARRAY_TEST_5(ARRAY_TEST_5_DATA::random(rng))),
35054 ARRAY_TEST_6_DATA::ID => Some(Self::ARRAY_TEST_6(ARRAY_TEST_6_DATA::random(rng))),
35055 ARRAY_TEST_7_DATA::ID => Some(Self::ARRAY_TEST_7(ARRAY_TEST_7_DATA::random(rng))),
35056 ARRAY_TEST_8_DATA::ID => Some(Self::ARRAY_TEST_8(ARRAY_TEST_8_DATA::random(rng))),
35057 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35058 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35059 ATTITUDE_QUATERNION_DATA::random(rng),
35060 )),
35061 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35062 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35063 )),
35064 ATTITUDE_TARGET_DATA::ID => {
35065 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35066 }
35067 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35068 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35069 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35070 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35071 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35072 ))
35073 }
35074 AUTOPILOT_VERSION_DATA::ID => {
35075 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35076 }
35077 AVAILABLE_MODES_DATA::ID => {
35078 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35079 }
35080 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35081 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35082 )),
35083 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35084 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35085 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35086 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35087 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35088 )),
35089 CAMERA_FOV_STATUS_DATA::ID => {
35090 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35091 }
35092 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35093 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35094 )),
35095 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35096 CAMERA_INFORMATION_DATA::random(rng),
35097 )),
35098 CAMERA_SETTINGS_DATA::ID => {
35099 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35100 }
35101 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35102 CAMERA_THERMAL_RANGE_DATA::random(rng),
35103 )),
35104 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35105 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35106 )),
35107 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35108 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35109 )),
35110 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35111 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35112 CAN_FILTER_MODIFY_DATA::ID => {
35113 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35114 }
35115 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35116 CELLULAR_CONFIG_DATA::ID => {
35117 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35118 }
35119 CELLULAR_STATUS_DATA::ID => {
35120 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35121 }
35122 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35123 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35124 )),
35125 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35126 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35127 )),
35128 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35129 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35130 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35131 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35132 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35133 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35134 COMPONENT_INFORMATION_DATA::random(rng),
35135 )),
35136 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35137 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35138 )),
35139 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35140 COMPONENT_METADATA_DATA::random(rng),
35141 )),
35142 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35143 CONTROL_SYSTEM_STATE_DATA::random(rng),
35144 )),
35145 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35146 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35147 )),
35148 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35149 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35150 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35151 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35152 )),
35153 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35154 DEBUG_FLOAT_ARRAY_DATA::ID => {
35155 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35156 }
35157 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35158 DISTANCE_SENSOR_DATA::ID => {
35159 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35160 }
35161 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35162 ENCAPSULATED_DATA_DATA::ID => {
35163 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35164 }
35165 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35166 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35167 ESTIMATOR_STATUS_DATA::ID => {
35168 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35169 }
35170 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35171 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35172 EXTENDED_SYS_STATE_DATA::random(rng),
35173 )),
35174 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35175 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35176 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35177 )),
35178 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35179 FLIGHT_INFORMATION_DATA::random(rng),
35180 )),
35181 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35182 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35183 GENERATOR_STATUS_DATA::ID => {
35184 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35185 }
35186 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35187 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35188 )),
35189 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35190 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35191 )),
35192 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35193 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35194 )),
35195 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35196 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35197 )),
35198 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35199 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35200 )),
35201 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35202 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35203 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35204 ))
35205 }
35206 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35207 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35208 )),
35209 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35210 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35211 )),
35212 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35213 GLOBAL_POSITION_INT_DATA::random(rng),
35214 )),
35215 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35216 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35217 )),
35218 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35219 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35220 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35221 ))
35222 }
35223 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35224 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35225 GPS_GLOBAL_ORIGIN_DATA::ID => {
35226 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35227 }
35228 GPS_INJECT_DATA_DATA::ID => {
35229 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35230 }
35231 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35232 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35233 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35234 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35235 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35236 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35237 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35238 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35239 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35240 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35241 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35242 )),
35243 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35244 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35245 HIL_OPTICAL_FLOW_DATA::ID => {
35246 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35247 }
35248 HIL_RC_INPUTS_RAW_DATA::ID => {
35249 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35250 }
35251 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35252 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35253 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35254 HIL_STATE_QUATERNION_DATA::random(rng),
35255 )),
35256 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35257 HYGROMETER_SENSOR_DATA::ID => {
35258 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35259 }
35260 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35261 ILLUMINATOR_STATUS_DATA::random(rng),
35262 )),
35263 ISBD_LINK_STATUS_DATA::ID => {
35264 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35265 }
35266 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35267 LINK_NODE_STATUS_DATA::ID => {
35268 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35269 }
35270 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35271 LOCAL_POSITION_NED_DATA::random(rng),
35272 )),
35273 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35274 LOCAL_POSITION_NED_COV_DATA::random(rng),
35275 )),
35276 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35277 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35278 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35279 ))
35280 }
35281 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35282 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35283 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35284 LOGGING_DATA_ACKED_DATA::random(rng),
35285 )),
35286 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35287 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35288 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35289 LOG_REQUEST_DATA_DATA::ID => {
35290 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35291 }
35292 LOG_REQUEST_END_DATA::ID => {
35293 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35294 }
35295 LOG_REQUEST_LIST_DATA::ID => {
35296 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35297 }
35298 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35299 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35300 MANUAL_SETPOINT_DATA::ID => {
35301 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35302 }
35303 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35304 MESSAGE_INTERVAL_DATA::ID => {
35305 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35306 }
35307 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35308 MISSION_CLEAR_ALL_DATA::ID => {
35309 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35310 }
35311 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35312 MISSION_CURRENT_DATA::ID => {
35313 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35314 }
35315 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35316 MISSION_ITEM_INT_DATA::ID => {
35317 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35318 }
35319 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35320 MISSION_ITEM_REACHED_DATA::random(rng),
35321 )),
35322 MISSION_REQUEST_DATA::ID => {
35323 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
35324 }
35325 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35326 MISSION_REQUEST_INT_DATA::random(rng),
35327 )),
35328 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35329 MISSION_REQUEST_LIST_DATA::random(rng),
35330 )),
35331 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35332 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
35333 )),
35334 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35335 MISSION_SET_CURRENT_DATA::random(rng),
35336 )),
35337 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35338 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
35339 )),
35340 MOUNT_ORIENTATION_DATA::ID => {
35341 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
35342 }
35343 NAMED_VALUE_FLOAT_DATA::ID => {
35344 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
35345 }
35346 NAMED_VALUE_INT_DATA::ID => {
35347 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
35348 }
35349 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35350 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
35351 )),
35352 OBSTACLE_DISTANCE_DATA::ID => {
35353 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
35354 }
35355 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
35356 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35357 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
35358 )),
35359 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35360 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
35361 )),
35362 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35363 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
35364 )),
35365 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35366 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
35367 )),
35368 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35369 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
35370 )),
35371 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35372 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
35373 )),
35374 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35375 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
35376 )),
35377 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35378 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
35379 )),
35380 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35381 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
35382 )),
35383 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35384 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
35385 )),
35386 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
35387 OPTICAL_FLOW_RAD_DATA::ID => {
35388 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
35389 }
35390 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35391 ORBIT_EXECUTION_STATUS_DATA::random(rng),
35392 )),
35393 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
35394 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35395 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
35396 )),
35397 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35398 PARAM_EXT_REQUEST_READ_DATA::random(rng),
35399 )),
35400 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
35401 PARAM_EXT_VALUE_DATA::ID => {
35402 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
35403 }
35404 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
35405 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
35406 PARAM_REQUEST_LIST_DATA::random(rng),
35407 )),
35408 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
35409 PARAM_REQUEST_READ_DATA::random(rng),
35410 )),
35411 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
35412 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
35413 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
35414 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
35415 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
35416 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35417 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35418 )),
35419 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35420 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35421 )),
35422 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
35423 PROTOCOL_VERSION_DATA::ID => {
35424 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35425 }
35426 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35427 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35428 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35429 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35430 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35431 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35432 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35433 )),
35434 RC_CHANNELS_RAW_DATA::ID => {
35435 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35436 }
35437 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35438 RC_CHANNELS_SCALED_DATA::random(rng),
35439 )),
35440 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35441 REQUEST_DATA_STREAM_DATA::random(rng),
35442 )),
35443 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35444 RESOURCE_REQUEST_DATA::ID => {
35445 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35446 }
35447 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35448 RESPONSE_EVENT_ERROR_DATA::random(rng),
35449 )),
35450 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35451 SAFETY_ALLOWED_AREA_DATA::random(rng),
35452 )),
35453 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35454 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35455 )),
35456 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35457 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35458 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35459 SCALED_PRESSURE_DATA::ID => {
35460 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35461 }
35462 SCALED_PRESSURE2_DATA::ID => {
35463 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35464 }
35465 SCALED_PRESSURE3_DATA::ID => {
35466 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35467 }
35468 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35469 SERVO_OUTPUT_RAW_DATA::ID => {
35470 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35471 }
35472 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35473 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35474 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35475 )),
35476 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35477 SET_ATTITUDE_TARGET_DATA::random(rng),
35478 )),
35479 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35480 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35481 )),
35482 SET_HOME_POSITION_DATA::ID => {
35483 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35484 }
35485 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35486 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35487 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35488 )),
35489 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35490 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35491 )),
35492 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35493 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35494 SMART_BATTERY_INFO_DATA::random(rng),
35495 )),
35496 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35497 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35498 STORAGE_INFORMATION_DATA::random(rng),
35499 )),
35500 SUPPORTED_TUNES_DATA::ID => {
35501 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35502 }
35503 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35504 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35505 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35506 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35507 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35508 TERRAIN_REQUEST_DATA::ID => {
35509 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35510 }
35511 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35512 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35513 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35514 )),
35515 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35516 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35517 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35518 ))
35519 }
35520 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35521 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35522 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35523 ))
35524 }
35525 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35526 UAVCAN_NODE_INFO_DATA::ID => {
35527 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35528 }
35529 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35530 UAVCAN_NODE_STATUS_DATA::random(rng),
35531 )),
35532 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35533 UTM_GLOBAL_POSITION_DATA::random(rng),
35534 )),
35535 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35536 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35537 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35538 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35539 VICON_POSITION_ESTIMATE_DATA::random(rng),
35540 )),
35541 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35542 VIDEO_STREAM_INFORMATION_DATA::random(rng),
35543 )),
35544 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35545 VIDEO_STREAM_STATUS_DATA::random(rng),
35546 )),
35547 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35548 VISION_POSITION_ESTIMATE_DATA::random(rng),
35549 )),
35550 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35551 VISION_SPEED_ESTIMATE_DATA::random(rng),
35552 )),
35553 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
35554 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
35555 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
35556 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
35557 _ => None,
35558 }
35559 }
35560 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35561 match self {
35562 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35563 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
35564 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
35565 Self::AIS_VESSEL(body) => body.ser(version, bytes),
35566 Self::ALTITUDE(body) => body.ser(version, bytes),
35567 Self::ARRAY_TEST_0(body) => body.ser(version, bytes),
35568 Self::ARRAY_TEST_1(body) => body.ser(version, bytes),
35569 Self::ARRAY_TEST_3(body) => body.ser(version, bytes),
35570 Self::ARRAY_TEST_4(body) => body.ser(version, bytes),
35571 Self::ARRAY_TEST_5(body) => body.ser(version, bytes),
35572 Self::ARRAY_TEST_6(body) => body.ser(version, bytes),
35573 Self::ARRAY_TEST_7(body) => body.ser(version, bytes),
35574 Self::ARRAY_TEST_8(body) => body.ser(version, bytes),
35575 Self::ATTITUDE(body) => body.ser(version, bytes),
35576 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
35577 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
35578 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
35579 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
35580 Self::AUTH_KEY(body) => body.ser(version, bytes),
35581 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
35582 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
35583 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
35584 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
35585 Self::BATTERY_INFO(body) => body.ser(version, bytes),
35586 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
35587 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
35588 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
35589 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
35590 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
35591 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
35592 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
35593 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
35594 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
35595 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
35596 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
35597 Self::CANFD_FRAME(body) => body.ser(version, bytes),
35598 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
35599 Self::CAN_FRAME(body) => body.ser(version, bytes),
35600 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
35601 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
35602 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
35603 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
35604 Self::COLLISION(body) => body.ser(version, bytes),
35605 Self::COMMAND_ACK(body) => body.ser(version, bytes),
35606 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
35607 Self::COMMAND_INT(body) => body.ser(version, bytes),
35608 Self::COMMAND_LONG(body) => body.ser(version, bytes),
35609 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
35610 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
35611 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
35612 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
35613 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
35614 Self::CURRENT_MODE(body) => body.ser(version, bytes),
35615 Self::DATA_STREAM(body) => body.ser(version, bytes),
35616 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
35617 Self::DEBUG(body) => body.ser(version, bytes),
35618 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
35619 Self::DEBUG_VECT(body) => body.ser(version, bytes),
35620 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
35621 Self::EFI_STATUS(body) => body.ser(version, bytes),
35622 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
35623 Self::ESC_INFO(body) => body.ser(version, bytes),
35624 Self::ESC_STATUS(body) => body.ser(version, bytes),
35625 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
35626 Self::EVENT(body) => body.ser(version, bytes),
35627 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
35628 Self::FENCE_STATUS(body) => body.ser(version, bytes),
35629 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
35630 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
35631 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
35632 Self::FUEL_STATUS(body) => body.ser(version, bytes),
35633 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
35634 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
35635 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
35636 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
35637 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
35638 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
35639 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
35640 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
35641 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
35642 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
35643 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
35644 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35645 Self::GPS2_RAW(body) => body.ser(version, bytes),
35646 Self::GPS2_RTK(body) => body.ser(version, bytes),
35647 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35648 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
35649 Self::GPS_INPUT(body) => body.ser(version, bytes),
35650 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
35651 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
35652 Self::GPS_RTK(body) => body.ser(version, bytes),
35653 Self::GPS_STATUS(body) => body.ser(version, bytes),
35654 Self::HEARTBEAT(body) => body.ser(version, bytes),
35655 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
35656 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
35657 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
35658 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
35659 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
35660 Self::HIL_GPS(body) => body.ser(version, bytes),
35661 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
35662 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
35663 Self::HIL_SENSOR(body) => body.ser(version, bytes),
35664 Self::HIL_STATE(body) => body.ser(version, bytes),
35665 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
35666 Self::HOME_POSITION(body) => body.ser(version, bytes),
35667 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
35668 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
35669 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
35670 Self::LANDING_TARGET(body) => body.ser(version, bytes),
35671 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
35672 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
35673 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
35674 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
35675 Self::LOGGING_ACK(body) => body.ser(version, bytes),
35676 Self::LOGGING_DATA(body) => body.ser(version, bytes),
35677 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
35678 Self::LOG_DATA(body) => body.ser(version, bytes),
35679 Self::LOG_ENTRY(body) => body.ser(version, bytes),
35680 Self::LOG_ERASE(body) => body.ser(version, bytes),
35681 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
35682 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
35683 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
35684 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
35685 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
35686 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
35687 Self::MEMORY_VECT(body) => body.ser(version, bytes),
35688 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
35689 Self::MISSION_ACK(body) => body.ser(version, bytes),
35690 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
35691 Self::MISSION_COUNT(body) => body.ser(version, bytes),
35692 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
35693 Self::MISSION_ITEM(body) => body.ser(version, bytes),
35694 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
35695 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
35696 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
35697 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
35698 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
35699 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
35700 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
35701 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
35702 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
35703 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
35704 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
35705 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
35706 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
35707 Self::ODOMETRY(body) => body.ser(version, bytes),
35708 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
35709 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
35710 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
35711 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
35712 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
35713 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
35714 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
35715 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
35716 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
35717 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
35718 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
35719 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
35720 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
35721 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
35722 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
35723 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
35724 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
35725 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
35726 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
35727 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
35728 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
35729 Self::PARAM_SET(body) => body.ser(version, bytes),
35730 Self::PARAM_VALUE(body) => body.ser(version, bytes),
35731 Self::PING(body) => body.ser(version, bytes),
35732 Self::PLAY_TUNE(body) => body.ser(version, bytes),
35733 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
35734 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35735 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35736 Self::POWER_STATUS(body) => body.ser(version, bytes),
35737 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
35738 Self::RADIO_STATUS(body) => body.ser(version, bytes),
35739 Self::RAW_IMU(body) => body.ser(version, bytes),
35740 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
35741 Self::RAW_RPM(body) => body.ser(version, bytes),
35742 Self::RC_CHANNELS(body) => body.ser(version, bytes),
35743 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
35744 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
35745 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
35746 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
35747 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
35748 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
35749 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
35750 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
35751 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
35752 Self::SCALED_IMU(body) => body.ser(version, bytes),
35753 Self::SCALED_IMU2(body) => body.ser(version, bytes),
35754 Self::SCALED_IMU3(body) => body.ser(version, bytes),
35755 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
35756 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
35757 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
35758 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
35759 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
35760 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
35761 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35762 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
35763 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35764 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
35765 Self::SET_MODE(body) => body.ser(version, bytes),
35766 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35767 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35768 Self::SIM_STATE(body) => body.ser(version, bytes),
35769 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
35770 Self::STATUSTEXT(body) => body.ser(version, bytes),
35771 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
35772 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
35773 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
35774 Self::SYS_STATUS(body) => body.ser(version, bytes),
35775 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
35776 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
35777 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
35778 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
35779 Self::TIMESYNC(body) => body.ser(version, bytes),
35780 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
35781 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
35782 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
35783 Self::TUNNEL(body) => body.ser(version, bytes),
35784 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
35785 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
35786 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
35787 Self::V2_EXTENSION(body) => body.ser(version, bytes),
35788 Self::VFR_HUD(body) => body.ser(version, bytes),
35789 Self::VIBRATION(body) => body.ser(version, bytes),
35790 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35791 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
35792 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
35793 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35794 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
35795 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
35796 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
35797 Self::WINCH_STATUS(body) => body.ser(version, bytes),
35798 Self::WIND_COV(body) => body.ser(version, bytes),
35799 }
35800 }
35801 fn extra_crc(id: u32) -> u8 {
35802 match id {
35803 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35804 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
35805 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
35806 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
35807 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
35808 ARRAY_TEST_0_DATA::ID => ARRAY_TEST_0_DATA::EXTRA_CRC,
35809 ARRAY_TEST_1_DATA::ID => ARRAY_TEST_1_DATA::EXTRA_CRC,
35810 ARRAY_TEST_3_DATA::ID => ARRAY_TEST_3_DATA::EXTRA_CRC,
35811 ARRAY_TEST_4_DATA::ID => ARRAY_TEST_4_DATA::EXTRA_CRC,
35812 ARRAY_TEST_5_DATA::ID => ARRAY_TEST_5_DATA::EXTRA_CRC,
35813 ARRAY_TEST_6_DATA::ID => ARRAY_TEST_6_DATA::EXTRA_CRC,
35814 ARRAY_TEST_7_DATA::ID => ARRAY_TEST_7_DATA::EXTRA_CRC,
35815 ARRAY_TEST_8_DATA::ID => ARRAY_TEST_8_DATA::EXTRA_CRC,
35816 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
35817 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
35818 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
35819 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
35820 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
35821 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
35822 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35823 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
35824 }
35825 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
35826 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
35827 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
35828 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
35829 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
35830 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
35831 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
35832 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
35833 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
35834 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
35835 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
35836 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
35837 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
35838 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
35839 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
35840 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
35841 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
35842 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
35843 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
35844 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
35845 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
35846 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
35847 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
35848 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
35849 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
35850 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
35851 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
35852 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
35853 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
35854 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
35855 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
35856 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
35857 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
35858 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
35859 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
35860 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
35861 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
35862 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
35863 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
35864 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
35865 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
35866 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
35867 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
35868 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
35869 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
35870 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
35871 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
35872 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
35873 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
35874 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
35875 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
35876 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
35877 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
35878 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
35879 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
35880 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
35881 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
35882 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35883 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
35884 }
35885 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
35886 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
35887 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
35888 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
35889 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35890 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
35891 }
35892 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
35893 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
35894 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35895 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
35896 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
35897 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
35898 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
35899 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
35900 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
35901 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
35902 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
35903 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
35904 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
35905 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
35906 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
35907 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
35908 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
35909 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
35910 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
35911 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
35912 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
35913 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
35914 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
35915 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
35916 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
35917 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
35918 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
35919 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
35920 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
35921 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35922 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
35923 }
35924 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
35925 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
35926 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
35927 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
35928 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
35929 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
35930 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
35931 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
35932 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
35933 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
35934 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
35935 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
35936 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
35937 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
35938 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
35939 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
35940 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
35941 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
35942 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
35943 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
35944 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
35945 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
35946 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
35947 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
35948 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
35949 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
35950 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
35951 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
35952 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
35953 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
35954 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
35955 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
35956 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
35957 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
35958 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
35959 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
35960 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
35961 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
35962 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
35963 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
35964 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
35965 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
35966 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
35967 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
35968 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
35969 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
35970 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
35971 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
35972 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
35973 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
35974 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
35975 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
35976 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
35977 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
35978 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
35979 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
35980 PING_DATA::ID => PING_DATA::EXTRA_CRC,
35981 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
35982 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
35983 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
35984 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35985 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
35986 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
35987 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
35988 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
35989 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
35990 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
35991 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
35992 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
35993 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
35994 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
35995 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
35996 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
35997 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
35998 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
35999 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36000 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36001 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36002 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36003 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36004 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36005 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36006 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36007 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36008 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36009 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36010 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36011 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36012 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36013 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36014 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36015 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36016 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36017 }
36018 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36019 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36020 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36021 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36022 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36023 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36024 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36025 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36026 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36027 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36028 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36029 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36030 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36031 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36032 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36033 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36034 }
36035 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36036 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36037 }
36038 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36039 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36040 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36041 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36042 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36043 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36044 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36045 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36046 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36047 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36048 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36049 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36050 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36051 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36052 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36053 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36054 _ => 0,
36055 }
36056 }
36057 fn target_system_id(&self) -> Option<u8> {
36058 match self {
36059 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36060 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36061 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36062 Self::CAN_FRAME(inner) => Some(inner.target_system),
36063 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36064 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36065 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36066 Self::COMMAND_INT(inner) => Some(inner.target_system),
36067 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36068 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36069 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36070 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36071 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36072 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36073 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36074 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36075 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36076 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36077 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36078 Self::LOG_ERASE(inner) => Some(inner.target_system),
36079 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36080 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36081 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36082 Self::MISSION_ACK(inner) => Some(inner.target_system),
36083 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36084 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36085 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36086 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36087 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36088 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36089 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36090 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36091 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36092 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36093 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36094 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36095 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36096 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36097 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36098 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36099 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36100 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36101 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36102 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36103 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36104 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36105 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36106 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36107 Self::PARAM_SET(inner) => Some(inner.target_system),
36108 Self::PING(inner) => Some(inner.target_system),
36109 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36110 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36111 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36112 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36113 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36114 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36115 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36116 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36117 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36118 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36119 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36120 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36121 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36122 Self::SET_MODE(inner) => Some(inner.target_system),
36123 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36124 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36125 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36126 Self::TIMESYNC(inner) => Some(inner.target_system),
36127 Self::TUNNEL(inner) => Some(inner.target_system),
36128 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36129 _ => None,
36130 }
36131 }
36132 fn target_component_id(&self) -> Option<u8> {
36133 match self {
36134 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36135 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36136 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36137 Self::CAN_FRAME(inner) => Some(inner.target_component),
36138 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36139 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36140 Self::COMMAND_INT(inner) => Some(inner.target_component),
36141 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36142 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36143 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36144 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36145 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36146 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36147 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36148 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36149 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36150 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36151 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36152 Self::LOG_ERASE(inner) => Some(inner.target_component),
36153 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36154 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36155 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36156 Self::MISSION_ACK(inner) => Some(inner.target_component),
36157 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36158 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36159 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36160 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36161 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36162 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36163 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36164 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36165 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36166 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36167 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36168 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36169 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36170 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36171 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36172 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36173 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36174 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36175 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36176 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36177 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36178 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36179 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36180 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36181 Self::PARAM_SET(inner) => Some(inner.target_component),
36182 Self::PING(inner) => Some(inner.target_component),
36183 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36184 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36185 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36186 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36187 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36188 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36189 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36190 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36191 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36192 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36193 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36194 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36195 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36196 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36197 Self::TIMESYNC(inner) => Some(inner.target_component),
36198 Self::TUNNEL(inner) => Some(inner.target_component),
36199 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36200 _ => None,
36201 }
36202 }
36203}